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,543 @@
1
+ # Column
2
+
3
+ Access and manage board columns via the `client.column` resource.
4
+
5
+ ::: 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>What are Columns?</span>
6
+ Columns define the structure of your board and the types of information you can track for each item (e.g., status, dates, people, text).
7
+ :::
8
+
9
+ ## Methods
10
+
11
+ ### query
12
+
13
+ Retrieves columns for boards.
14
+
15
+ ```ruby
16
+ client.column.query(args: {}, select: DEFAULT_SELECT)
17
+ ```
18
+
19
+ **Parameters:**
20
+
21
+ | Name | Type | Default | Description |
22
+ |------|------|---------|-------------|
23
+ | `args` | Hash | `{}` | Query arguments (see [boards query](https://developer.monday.com/api-reference/reference/boards#queries)) |
24
+ | `select` | Array | `["id", "title", "description"]` | Fields to retrieve |
25
+
26
+ **Returns:** `Monday::Response`
27
+
28
+ **Common args:**
29
+ - `ids` - Array of board IDs
30
+
31
+ **Response Structure:**
32
+
33
+ Columns are nested under boards:
34
+
35
+ ```ruby
36
+ boards = response.body.dig("data", "boards")
37
+ columns = boards.first&.dig("columns") || []
38
+ ```
39
+
40
+ **Example:**
41
+
42
+ ```ruby
43
+ response = client.column.query(
44
+ args: { ids: [1234567890] }
45
+ )
46
+
47
+ if response.success?
48
+ boards = response.body.dig("data", "boards")
49
+ columns = boards.first&.dig("columns") || []
50
+
51
+ puts "Found #{columns.length} columns"
52
+ columns.each do |column|
53
+ puts " • #{column['title']}: '#{column['id']}' (#{column['type']})"
54
+ end
55
+ end
56
+ ```
57
+
58
+ **GraphQL:** `query { boards { columns { ... } } }`
59
+
60
+ **See:** [monday.com columns query](https://developer.monday.com/api-reference/reference/columns)
61
+
62
+ ### create
63
+
64
+ Creates a new column on a board.
65
+
66
+ ```ruby
67
+ client.column.create(args: {}, select: DEFAULT_SELECT)
68
+ ```
69
+
70
+ **Parameters:**
71
+
72
+ | Name | Type | Default | Description |
73
+ |------|------|---------|-------------|
74
+ | `args` | Hash | `{}` | Creation arguments (required) |
75
+ | `select` | Array | `["id", "title", "description"]` | Fields to retrieve |
76
+
77
+ **Required args:**
78
+ - `board_id` - Integer - Board ID
79
+ - `title` - String - Column title
80
+ - `column_type` - Symbol - Column type
81
+
82
+ **Optional args:**
83
+ - `description` - String - Column description
84
+ - `defaults` - String (JSON) - Default column settings
85
+
86
+ **Returns:** `Monday::Response`
87
+
88
+ **Available Column Types:**
89
+
90
+ - `:text` - Short text
91
+ - `:long_text` - Long text with formatting
92
+ - `:color` - Status with labels
93
+ - `:date` - Date and time
94
+ - `:people` - Person or team
95
+ - `:numbers` - Numeric values
96
+ - `:timeline` - Date range
97
+ - `:dropdown` - Dropdown selection
98
+ - `:email` - Email address
99
+ - `:phone` - Phone number
100
+ - `:link` - URL
101
+ - `:checkbox` - Checkbox
102
+ - `:rating` - Star rating
103
+ - `:hour` - Time tracking
104
+ - `:week` - Week selector
105
+ - `:country` - Country selector
106
+ - `:file` - File attachment
107
+ - `:location` - Geographic location
108
+ - `:tag` - Tags
109
+
110
+ **Example:**
111
+
112
+ ```ruby
113
+ response = client.column.create(
114
+ args: {
115
+ board_id: 1234567890,
116
+ title: "Priority",
117
+ column_type: :color,
118
+ description: "Task priority level"
119
+ }
120
+ )
121
+
122
+ if response.success?
123
+ column = response.body.dig("data", "create_column")
124
+ puts "Created: #{column['title']} (ID: #{column['id']})"
125
+ end
126
+ ```
127
+
128
+ **GraphQL:** `mutation { create_column { ... } }`
129
+
130
+ **See:** [monday.com create_column](https://developer.monday.com/api-reference/reference/columns#create-column)
131
+
132
+ ### change_value
133
+
134
+ Updates a column value for a specific item.
135
+
136
+ ```ruby
137
+ client.column.change_value(args: {}, select: ["id", "name"])
138
+ ```
139
+
140
+ **Parameters:**
141
+
142
+ | Name | Type | Default | Description |
143
+ |------|------|---------|-------------|
144
+ | `args` | Hash | `{}` | Update arguments (required) |
145
+ | `select` | Array | `["id", "name"]` | Item fields to retrieve |
146
+
147
+ **Required args:**
148
+ - `board_id` - Integer - Board ID
149
+ - `item_id` - Integer - Item ID
150
+ - `column_id` - String - Column ID
151
+ - `value` - String (JSON) - New column value
152
+
153
+ **Optional args:**
154
+ - `create_labels_if_missing` - Boolean - Auto-create status labels
155
+
156
+ **Returns:** `Monday::Response`
157
+
158
+ **Example:**
159
+
160
+ ```ruby
161
+ require "json"
162
+
163
+ response = client.column.change_value(
164
+ args: {
165
+ board_id: 1234567890,
166
+ item_id: 987654321,
167
+ column_id: "status",
168
+ value: JSON.generate({ label: "Done" })
169
+ }
170
+ )
171
+
172
+ if response.success?
173
+ item = response.body.dig("data", "change_column_value")
174
+ puts "Updated: #{item['name']}"
175
+ end
176
+ ```
177
+
178
+ **GraphQL:** `mutation { change_column_value { ... } }`
179
+
180
+ **See:** [monday.com change_column_value](https://developer.monday.com/api-reference/reference/columns#change-column-value)
181
+
182
+ ### change_simple_value
183
+
184
+ Updates a simple column value (text, numbers).
185
+
186
+ ```ruby
187
+ client.column.change_simple_value(args: {}, select: ["id", "name"])
188
+ ```
189
+
190
+ **Parameters:**
191
+
192
+ | Name | Type | Default | Description |
193
+ |------|------|---------|-------------|
194
+ | `args` | Hash | `{}` | Update arguments (required) |
195
+ | `select` | Array | `["id", "name"]` | Item fields to retrieve |
196
+
197
+ **Required args:**
198
+ - `board_id` - Integer - Board ID
199
+ - `item_id` - Integer - Item ID
200
+ - `column_id` - String - Column ID
201
+ - `value` - String - New value
202
+
203
+ **Returns:** `Monday::Response`
204
+
205
+ **Example:**
206
+
207
+ ```ruby
208
+ response = client.column.change_simple_value(
209
+ args: {
210
+ board_id: 1234567890,
211
+ item_id: 987654321,
212
+ column_id: "text",
213
+ value: "Updated text content"
214
+ }
215
+ )
216
+
217
+ if response.success?
218
+ item = response.body.dig("data", "change_simple_column_value")
219
+ puts "Updated: #{item['name']}"
220
+ end
221
+ ```
222
+
223
+ **GraphQL:** `mutation { change_simple_column_value { ... } }`
224
+
225
+ **See:** [monday.com change_simple_column_value](https://developer.monday.com/api-reference/reference/columns#change-simple-column-value)
226
+
227
+ ### change_multiple_values
228
+
229
+ Updates multiple column values for an item at once.
230
+
231
+ ```ruby
232
+ client.column.change_multiple_values(args: {}, select: ["id", "name"])
233
+ ```
234
+
235
+ **Parameters:**
236
+
237
+ | Name | Type | Default | Description |
238
+ |------|------|---------|-------------|
239
+ | `args` | Hash | `{}` | Update arguments (required) |
240
+ | `select` | Array | `["id", "name"]` | Item fields to retrieve |
241
+
242
+ **Required args:**
243
+ - `board_id` - Integer - Board ID
244
+ - `item_id` - Integer - Item ID
245
+ - `column_values` - String (JSON) - Hash of column values
246
+
247
+ **Optional args:**
248
+ - `create_labels_if_missing` - Boolean - Auto-create status labels
249
+
250
+ **Returns:** `Monday::Response`
251
+
252
+ **Example:**
253
+
254
+ ```ruby
255
+ require "json"
256
+
257
+ column_values = {
258
+ status: { label: "Working on it" },
259
+ text: "High priority",
260
+ numbers: 85
261
+ }
262
+
263
+ response = client.column.change_multiple_values(
264
+ args: {
265
+ board_id: 1234567890,
266
+ item_id: 987654321,
267
+ column_values: JSON.generate(column_values)
268
+ }
269
+ )
270
+
271
+ if response.success?
272
+ item = response.body.dig("data", "change_multiple_column_values")
273
+ puts "Updated multiple columns for: #{item['name']}"
274
+ end
275
+ ```
276
+
277
+ **GraphQL:** `mutation { change_multiple_column_values { ... } }`
278
+
279
+ **See:** [monday.com change_multiple_column_values](https://developer.monday.com/api-reference/reference/columns#change-multiple-column-values)
280
+
281
+ ### change_title
282
+
283
+ Updates a column's title.
284
+
285
+ ```ruby
286
+ client.column.change_title(args: {}, select: DEFAULT_SELECT)
287
+ ```
288
+
289
+ **Parameters:**
290
+
291
+ | Name | Type | Default | Description |
292
+ |------|------|---------|-------------|
293
+ | `args` | Hash | `{}` | Update arguments (required) |
294
+ | `select` | Array | `["id", "title", "description"]` | Fields to retrieve |
295
+
296
+ **Required args:**
297
+ - `board_id` - Integer - Board ID
298
+ - `column_id` - String - Column ID
299
+ - `title` - String - New title
300
+
301
+ **Returns:** `Monday::Response`
302
+
303
+ **Example:**
304
+
305
+ ```ruby
306
+ response = client.column.change_title(
307
+ args: {
308
+ board_id: 1234567890,
309
+ column_id: "text_1",
310
+ title: "Project Notes"
311
+ }
312
+ )
313
+
314
+ if response.success?
315
+ column = response.body.dig("data", "change_column_title")
316
+ puts "Renamed to: #{column['title']}"
317
+ end
318
+ ```
319
+
320
+ **GraphQL:** `mutation { change_column_title { ... } }`
321
+
322
+ **See:** [monday.com change_column_title](https://developer.monday.com/api-reference/reference/columns#change-column-title)
323
+
324
+ ### change_metadata
325
+
326
+ Updates column metadata (settings, description).
327
+
328
+ ```ruby
329
+ client.column.change_metadata(args: {}, select: DEFAULT_SELECT)
330
+ ```
331
+
332
+ **Parameters:**
333
+
334
+ | Name | Type | Default | Description |
335
+ |------|------|---------|-------------|
336
+ | `args` | Hash | `{}` | Update arguments (required) |
337
+ | `select` | Array | `["id", "title", "description"]` | Fields to retrieve |
338
+
339
+ **Required args:**
340
+ - `board_id` - Integer - Board ID
341
+ - `column_id` - String - Column ID
342
+ - `column_property` - String - Property to update (e.g., "description", "labels")
343
+ - `value` - String - New value (JSON for complex properties)
344
+
345
+ **Returns:** `Monday::Response`
346
+
347
+ **Example:**
348
+
349
+ ```ruby
350
+ response = client.column.change_metadata(
351
+ args: {
352
+ board_id: 1234567890,
353
+ column_id: "status",
354
+ column_property: "description",
355
+ value: "Current task status"
356
+ }
357
+ )
358
+
359
+ if response.success?
360
+ column = response.body.dig("data", "change_column_metadata")
361
+ puts "Metadata updated for: #{column['title']}"
362
+ end
363
+ ```
364
+
365
+ **GraphQL:** `mutation { change_column_metadata { ... } }`
366
+
367
+ **See:** [monday.com change_column_metadata](https://developer.monday.com/api-reference/reference/columns#change-column-metadata)
368
+
369
+ ### delete
370
+
371
+ Deletes a column from a board.
372
+
373
+ ```ruby
374
+ client.column.delete(board_id, column_id, select: ["id"])
375
+ ```
376
+
377
+ **Parameters:**
378
+
379
+ | Name | Type | Default | Description |
380
+ |------|------|---------|-------------|
381
+ | `board_id` | Integer | - | Board ID (required) |
382
+ | `column_id` | String | - | Column ID to delete (required) |
383
+ | `select` | Array | `["id"]` | Fields to retrieve |
384
+
385
+ **Returns:** `Monday::Response`
386
+
387
+ ::: 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>Permanent Deletion</span>
388
+ Deleting a column removes it and all its data from every item. This cannot be undone.
389
+ :::
390
+
391
+ **Example:**
392
+
393
+ ```ruby
394
+ response = client.column.delete(1234567890, "text_1")
395
+
396
+ if response.success?
397
+ column = response.body.dig("data", "delete_column")
398
+ puts "Deleted column ID: #{column['id']}"
399
+ end
400
+ ```
401
+
402
+ **GraphQL:** `mutation { delete_column { ... } }`
403
+
404
+ **See:** [monday.com delete_column](https://developer.monday.com/api-reference/reference/columns#delete-column)
405
+
406
+ ### column_values (Deprecated)
407
+
408
+ ::: 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>Deprecated</span>
409
+ This method is deprecated and will be removed in v2.0.0. Use `client.item.query` with `column_values` select instead.
410
+ :::
411
+
412
+ ## Response Structure
413
+
414
+ All methods return a `Monday::Response` object. Access data using:
415
+
416
+ ```ruby
417
+ response.success? # => true/false
418
+ response.status # => 200
419
+ response.body # => Hash with GraphQL response
420
+ ```
421
+
422
+ ### Typical Response Pattern
423
+
424
+ ```ruby
425
+ response = client.column.create(
426
+ args: {
427
+ board_id: 1234567890,
428
+ title: "Status",
429
+ column_type: :color
430
+ }
431
+ )
432
+
433
+ if response.success?
434
+ column = response.body.dig("data", "create_column")
435
+ # Work with column
436
+ else
437
+ # Handle error
438
+ end
439
+ ```
440
+
441
+ ## Constants
442
+
443
+ ### DEFAULT_SELECT
444
+
445
+ Default fields returned by most column methods:
446
+
447
+ ```ruby
448
+ ["id", "title", "description"]
449
+ ```
450
+
451
+ ## Error Handling
452
+
453
+ Common errors when working with columns:
454
+
455
+ - `Monday::AuthorizationError` - Invalid or missing API token
456
+ - `Monday::InvalidRequestError` - Invalid board ID or column ID
457
+ - `Monday::Error` - Invalid column type, invalid field, or other API errors
458
+
459
+ **Example:**
460
+
461
+ ```ruby
462
+ begin
463
+ response = client.column.create(
464
+ args: {
465
+ board_id: 123, # Invalid ID
466
+ title: "Test",
467
+ column_type: :text
468
+ }
469
+ )
470
+ rescue Monday::InvalidRequestError => e
471
+ puts "Error: #{e.message}"
472
+ end
473
+ ```
474
+
475
+ See the [Error Handling guide](/guides/advanced/errors) for more details.
476
+
477
+ ## Column Value Formats
478
+
479
+ Different column types require different value formats:
480
+
481
+ ### Status (Color)
482
+
483
+ ```ruby
484
+ { label: "Done" }
485
+ # or
486
+ { index: 1 }
487
+ ```
488
+
489
+ ### Date
490
+
491
+ ```ruby
492
+ { date: "2024-12-31" }
493
+ # or
494
+ { date: "2024-12-31", time: "14:30:00" }
495
+ ```
496
+
497
+ ### People
498
+
499
+ ```ruby
500
+ {
501
+ personsAndTeams: [
502
+ { id: 12345678, kind: "person" }
503
+ ]
504
+ }
505
+ ```
506
+
507
+ ### Timeline
508
+
509
+ ```ruby
510
+ { from: "2024-01-01", to: "2024-03-31" }
511
+ ```
512
+
513
+ ### Link
514
+
515
+ ```ruby
516
+ { url: "https://example.com", text: "Example" }
517
+ ```
518
+
519
+ ### Email
520
+
521
+ ```ruby
522
+ { email: "user@example.com", text: "Contact" }
523
+ ```
524
+
525
+ ### Checkbox
526
+
527
+ ```ruby
528
+ { checked: "true" }
529
+ ```
530
+
531
+ See the [Update Column Values guide](/guides/columns/update-values) for complete examples of all column types.
532
+
533
+ ## Related Resources
534
+
535
+ - [Item](/reference/resources/item) - Items with column values
536
+ - [Board](/reference/resources/board) - Boards containing columns
537
+ - [Group](/reference/resources/group) - Groups organizing items
538
+
539
+ ## External References
540
+
541
+ - [monday.com Columns API](https://developer.monday.com/api-reference/reference/columns)
542
+ - [GraphQL API Overview](https://developer.monday.com/api-reference/docs/introduction-to-graphql)
543
+ - [Column Types](https://support.monday.com/hc/en-us/articles/115005483545-All-About-Columns)