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,453 +0,0 @@
1
- # Update Board Settings
2
-
3
- Modify board properties like name, description, and communication settings.
4
-
5
- ## Update Board Name
6
-
7
- Change a board's display name:
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
- board_id = 1234567890
19
-
20
- response = client.board.update(
21
- args: {
22
- board_id: board_id,
23
- board_attribute: :name,
24
- new_value: "Updated Board Name"
25
- }
26
- )
27
-
28
- if response.success?
29
- result = JSON.parse(response.body["data"]["update_board"])
30
-
31
- if result["success"]
32
- puts "✓ Board name updated successfully"
33
- else
34
- puts "✗ Update failed"
35
- end
36
- end
37
- ```
38
-
39
- ## Update Board Description
40
-
41
- Modify the board's description:
42
-
43
- ```ruby
44
- board_id = 1234567890
45
-
46
- response = client.board.update(
47
- args: {
48
- board_id: board_id,
49
- board_attribute: :description,
50
- new_value: "This board tracks all Q1 2024 marketing campaigns and initiatives"
51
- }
52
- )
53
-
54
- if response.success?
55
- result = JSON.parse(response.body["data"]["update_board"])
56
-
57
- if result["success"]
58
- puts "✓ Description updated"
59
- else
60
- puts "✗ Update failed"
61
- end
62
- end
63
- ```
64
-
65
- ## Update Communication Setting
66
-
67
- Set the board's communication value (typically a meeting link or ID):
68
-
69
- ```ruby
70
- board_id = 1234567890
71
-
72
- response = client.board.update(
73
- args: {
74
- board_id: board_id,
75
- board_attribute: :communication,
76
- new_value: "https://zoom.us/j/123456789"
77
- }
78
- )
79
-
80
- if response.success?
81
- result = JSON.parse(response.body["data"]["update_board"])
82
-
83
- if result["success"]
84
- puts "✓ Communication setting updated"
85
- end
86
- end
87
- ```
88
-
89
- ## Response Structure
90
-
91
- The update response contains success status and undo data:
92
-
93
- ```ruby
94
- response = client.board.update(
95
- args: {
96
- board_id: 1234567890,
97
- board_attribute: :name,
98
- new_value: "New Name"
99
- }
100
- )
101
-
102
- if response.success?
103
- # Response is JSON string, needs parsing
104
- result = JSON.parse(response.body["data"]["update_board"])
105
-
106
- puts "Success: #{result['success']}"
107
- puts "Undo data: #{result['undo_data']}"
108
- end
109
- ```
110
-
111
- **Example response:**
112
- ```json
113
- {
114
- "success": true,
115
- "undo_data": "{\"undo_record_id\":123456,\"action_type\":\"update_board\"}"
116
- }
117
- ```
118
-
119
- ## Check Before Update
120
-
121
- Verify board exists before updating:
122
-
123
- ```ruby
124
- def board_exists?(client, board_id)
125
- response = client.board.query(
126
- args: { ids: [board_id] },
127
- select: ["id"]
128
- )
129
-
130
- return false unless response.success?
131
-
132
- boards = response.body.dig("data", "boards")
133
- !boards.empty?
134
- end
135
-
136
- board_id = 1234567890
137
-
138
- if board_exists?(client, board_id)
139
- response = client.board.update(
140
- args: {
141
- board_id: board_id,
142
- board_attribute: :name,
143
- new_value: "Updated Name"
144
- }
145
- )
146
- else
147
- puts "Board not found"
148
- end
149
- ```
150
-
151
- ## Update with Validation
152
-
153
- Validate input before updating:
154
-
155
- ```ruby
156
- def update_board_name(client, board_id, new_name)
157
- # Validate name
158
- if new_name.nil? || new_name.strip.empty?
159
- puts "✗ Name cannot be empty"
160
- return false
161
- end
162
-
163
- if new_name.length > 255
164
- puts "✗ Name too long (max 255 characters)"
165
- return false
166
- end
167
-
168
- # Update
169
- response = client.board.update(
170
- args: {
171
- board_id: board_id,
172
- board_attribute: :name,
173
- new_value: new_name
174
- }
175
- )
176
-
177
- if response.success?
178
- result = JSON.parse(response.body["data"]["update_board"])
179
-
180
- if result["success"]
181
- puts "✓ Board renamed to: #{new_name}"
182
- true
183
- else
184
- puts "✗ Update failed"
185
- false
186
- end
187
- else
188
- puts "✗ Request failed: #{response.status}"
189
- false
190
- end
191
- rescue Monday::AuthorizationError
192
- puts "✗ Board not found or no permission"
193
- false
194
- rescue Monday::Error => e
195
- puts "✗ API error: #{e.message}"
196
- false
197
- end
198
-
199
- # Usage
200
- update_board_name(client, 1234567890, "Q1 Marketing Campaigns")
201
- ```
202
-
203
- ## Batch Updates
204
-
205
- Update multiple attributes sequentially:
206
-
207
- ```ruby
208
- def update_board_details(client, board_id, name: nil, description: nil)
209
- updates = []
210
-
211
- if name
212
- updates << { attribute: :name, value: name }
213
- end
214
-
215
- if description
216
- updates << { attribute: :description, value: description }
217
- end
218
-
219
- updates.each do |update|
220
- response = client.board.update(
221
- args: {
222
- board_id: board_id,
223
- board_attribute: update[:attribute],
224
- new_value: update[:value]
225
- }
226
- )
227
-
228
- if response.success?
229
- result = JSON.parse(response.body["data"]["update_board"])
230
-
231
- if result["success"]
232
- puts "✓ Updated #{update[:attribute]}"
233
- else
234
- puts "✗ Failed to update #{update[:attribute]}"
235
- end
236
- else
237
- puts "✗ Request failed for #{update[:attribute]}"
238
- end
239
- end
240
- end
241
-
242
- # Usage
243
- update_board_details(
244
- client,
245
- 1234567890,
246
- name: "2024 Marketing Strategy",
247
- description: "Comprehensive marketing plan for fiscal year 2024"
248
- )
249
- ```
250
-
251
- **Output:**
252
- ```
253
- ✓ Updated name
254
- ✓ Updated description
255
- ```
256
-
257
- ## Error Handling
258
-
259
- Handle common update errors:
260
-
261
- ```ruby
262
- def safe_update_board(client, board_id, attribute, value)
263
- response = client.board.update(
264
- args: {
265
- board_id: board_id,
266
- board_attribute: attribute,
267
- new_value: value
268
- }
269
- )
270
-
271
- if response.success?
272
- result = JSON.parse(response.body["data"]["update_board"])
273
-
274
- if result["success"]
275
- puts "✓ Successfully updated #{attribute}"
276
- return true
277
- else
278
- puts "✗ Update rejected by API"
279
- return false
280
- end
281
- else
282
- puts "✗ Request failed with status: #{response.status}"
283
-
284
- if response.body["error_message"]
285
- puts " Error: #{response.body['error_message']}"
286
- end
287
-
288
- return false
289
- end
290
- rescue Monday::AuthorizationError
291
- puts "✗ No permission to update board #{board_id}"
292
- false
293
- rescue Monday::InvalidRequestError => e
294
- puts "✗ Invalid request: #{e.message}"
295
- false
296
- rescue Monday::Error => e
297
- puts "✗ API error: #{e.message}"
298
- false
299
- rescue JSON::ParserError
300
- puts "✗ Failed to parse response"
301
- false
302
- end
303
-
304
- # Usage
305
- safe_update_board(client, 1234567890, :name, "New Board Name")
306
- ```
307
-
308
- ## Verify Update
309
-
310
- Confirm the change was applied:
311
-
312
- ```ruby
313
- def update_and_verify(client, board_id, attribute, new_value)
314
- # Update
315
- response = client.board.update(
316
- args: {
317
- board_id: board_id,
318
- board_attribute: attribute,
319
- new_value: new_value
320
- }
321
- )
322
-
323
- return false unless response.success?
324
-
325
- result = JSON.parse(response.body["data"]["update_board"])
326
- return false unless result["success"]
327
-
328
- # Verify by querying
329
- verify_response = client.board.query(
330
- args: { ids: [board_id] },
331
- select: ["id", attribute.to_s]
332
- )
333
-
334
- if verify_response.success?
335
- board = verify_response.body.dig("data", "boards", 0)
336
- current_value = board[attribute.to_s]
337
-
338
- if current_value == new_value
339
- puts "✓ Update verified: #{attribute} = '#{new_value}'"
340
- true
341
- else
342
- puts "⚠ Update may not have applied correctly"
343
- puts " Expected: '#{new_value}'"
344
- puts " Got: '#{current_value}'"
345
- false
346
- end
347
- else
348
- puts "⚠ Could not verify update"
349
- false
350
- end
351
- end
352
-
353
- # Usage
354
- update_and_verify(
355
- client,
356
- 1234567890,
357
- :name,
358
- "Verified Board Name"
359
- )
360
- ```
361
-
362
- ## Available Attributes
363
-
364
- | Attribute | Type | Description |
365
- |-----------|------|-------------|
366
- | `:name` | String | Board display name |
367
- | `:description` | String | Board description text |
368
- | `:communication` | String | Communication link or meeting ID |
369
-
370
- ::: 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>Attribute Values</span>
371
- Only these three attributes can be updated via the `update_board` mutation. To change other properties (like permissions or workspace), use different methods.
372
- :::
373
-
374
- ## Complete Example
375
-
376
- Full update workflow with error handling:
377
-
378
- ```ruby
379
- require "monday_ruby"
380
- require "dotenv/load"
381
- require "json"
382
-
383
- Monday.configure do |config|
384
- config.token = ENV["MONDAY_TOKEN"]
385
- end
386
-
387
- client = Monday::Client.new
388
-
389
- # Board to update
390
- board_id = 1234567890
391
-
392
- puts "\n🔧 Updating Board Settings\n#{'=' * 50}\n"
393
-
394
- # Update name
395
- print "Updating name... "
396
- name_response = client.board.update(
397
- args: {
398
- board_id: board_id,
399
- board_attribute: :name,
400
- new_value: "2024 Q1 Strategy"
401
- }
402
- )
403
-
404
- if name_response.success?
405
- result = JSON.parse(name_response.body["data"]["update_board"])
406
- puts result["success"] ? "✓" : "✗"
407
- else
408
- puts "✗ (#{name_response.status})"
409
- end
410
-
411
- # Update description
412
- print "Updating description... "
413
- desc_response = client.board.update(
414
- args: {
415
- board_id: board_id,
416
- board_attribute: :description,
417
- new_value: "Strategic planning and execution for Q1 2024"
418
- }
419
- )
420
-
421
- if desc_response.success?
422
- result = JSON.parse(desc_response.body["data"]["update_board"])
423
- puts result["success"] ? "✓" : "✗"
424
- else
425
- puts "✗ (#{desc_response.status})"
426
- end
427
-
428
- # Verify changes
429
- puts "\nVerifying updates..."
430
- verify_response = client.board.query(
431
- args: { ids: [board_id] },
432
- select: ["id", "name", "description"]
433
- )
434
-
435
- if verify_response.success?
436
- board = verify_response.body.dig("data", "boards", 0)
437
-
438
- puts "\n#{'=' * 50}"
439
- puts "Updated Board:"
440
- puts " Name: #{board['name']}"
441
- puts " Description: #{board['description']}"
442
- puts "#{'=' * 50}\n"
443
- else
444
- puts "✗ Could not verify changes"
445
- end
446
- ```
447
-
448
- ## Next Steps
449
-
450
- - [Archive boards](/guides/boards/delete)
451
- - [Duplicate boards](/guides/boards/duplicate)
452
- - [Query boards](/guides/boards/query)
453
- - [Work with columns](/guides/columns/create)