monday_ruby 1.0.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 (93) hide show
  1. checksums.yaml +4 -4
  2. data/.env +1 -1
  3. data/.rspec +0 -1
  4. data/.rubocop.yml +19 -0
  5. data/.simplecov +1 -0
  6. data/CHANGELOG.md +49 -0
  7. data/CONTRIBUTING.md +165 -0
  8. data/README.md +167 -88
  9. data/docs/.vitepress/config.mjs +255 -0
  10. data/docs/.vitepress/theme/index.js +4 -0
  11. data/docs/.vitepress/theme/style.css +43 -0
  12. data/docs/README.md +80 -0
  13. data/docs/explanation/architecture.md +507 -0
  14. data/docs/explanation/best-practices/errors.md +478 -0
  15. data/docs/explanation/best-practices/performance.md +1084 -0
  16. data/docs/explanation/best-practices/rate-limiting.md +630 -0
  17. data/docs/explanation/best-practices/testing.md +820 -0
  18. data/docs/explanation/column-values.md +857 -0
  19. data/docs/explanation/design.md +795 -0
  20. data/docs/explanation/graphql.md +356 -0
  21. data/docs/explanation/migration/v1.md +808 -0
  22. data/docs/explanation/pagination.md +447 -0
  23. data/docs/guides/advanced/batch.md +1274 -0
  24. data/docs/guides/advanced/complex-queries.md +1114 -0
  25. data/docs/guides/advanced/errors.md +818 -0
  26. data/docs/guides/advanced/pagination.md +934 -0
  27. data/docs/guides/advanced/rate-limiting.md +981 -0
  28. data/docs/guides/authentication.md +286 -0
  29. data/docs/guides/boards/create.md +386 -0
  30. data/docs/guides/boards/delete.md +405 -0
  31. data/docs/guides/boards/duplicate.md +511 -0
  32. data/docs/guides/boards/query.md +530 -0
  33. data/docs/guides/boards/update.md +453 -0
  34. data/docs/guides/columns/create.md +452 -0
  35. data/docs/guides/columns/metadata.md +492 -0
  36. data/docs/guides/columns/query.md +455 -0
  37. data/docs/guides/columns/update-multiple.md +459 -0
  38. data/docs/guides/columns/update-values.md +509 -0
  39. data/docs/guides/files/add-to-column.md +40 -0
  40. data/docs/guides/files/add-to-update.md +37 -0
  41. data/docs/guides/files/clear-column.md +33 -0
  42. data/docs/guides/first-request.md +285 -0
  43. data/docs/guides/folders/manage.md +750 -0
  44. data/docs/guides/groups/items.md +626 -0
  45. data/docs/guides/groups/manage.md +501 -0
  46. data/docs/guides/installation.md +169 -0
  47. data/docs/guides/items/create.md +493 -0
  48. data/docs/guides/items/delete.md +514 -0
  49. data/docs/guides/items/query.md +605 -0
  50. data/docs/guides/items/subitems.md +483 -0
  51. data/docs/guides/items/update.md +699 -0
  52. data/docs/guides/updates/manage.md +619 -0
  53. data/docs/guides/use-cases/dashboard.md +1421 -0
  54. data/docs/guides/use-cases/import.md +1962 -0
  55. data/docs/guides/use-cases/task-management.md +1381 -0
  56. data/docs/guides/workspaces/manage.md +502 -0
  57. data/docs/index.md +69 -0
  58. data/docs/package-lock.json +2468 -0
  59. data/docs/package.json +13 -0
  60. data/docs/reference/client.md +540 -0
  61. data/docs/reference/configuration.md +586 -0
  62. data/docs/reference/errors.md +693 -0
  63. data/docs/reference/resources/account.md +208 -0
  64. data/docs/reference/resources/activity-log.md +369 -0
  65. data/docs/reference/resources/board-view.md +359 -0
  66. data/docs/reference/resources/board.md +393 -0
  67. data/docs/reference/resources/column.md +543 -0
  68. data/docs/reference/resources/file.md +236 -0
  69. data/docs/reference/resources/folder.md +386 -0
  70. data/docs/reference/resources/group.md +507 -0
  71. data/docs/reference/resources/item.md +348 -0
  72. data/docs/reference/resources/subitem.md +267 -0
  73. data/docs/reference/resources/update.md +259 -0
  74. data/docs/reference/resources/workspace.md +213 -0
  75. data/docs/reference/response.md +560 -0
  76. data/docs/tutorial/first-integration.md +713 -0
  77. data/lib/monday/client.rb +41 -2
  78. data/lib/monday/configuration.rb +13 -0
  79. data/lib/monday/deprecation.rb +23 -0
  80. data/lib/monday/error.rb +5 -2
  81. data/lib/monday/request.rb +19 -1
  82. data/lib/monday/resources/base.rb +4 -0
  83. data/lib/monday/resources/board.rb +52 -0
  84. data/lib/monday/resources/column.rb +6 -0
  85. data/lib/monday/resources/file.rb +56 -0
  86. data/lib/monday/resources/folder.rb +55 -0
  87. data/lib/monday/resources/group.rb +66 -0
  88. data/lib/monday/resources/item.rb +62 -0
  89. data/lib/monday/util.rb +33 -1
  90. data/lib/monday/version.rb +1 -1
  91. data/lib/monday_ruby.rb +1 -0
  92. metadata +92 -11
  93. data/monday_ruby.gemspec +0 -39
@@ -0,0 +1,359 @@
1
+ # Board View
2
+
3
+ Access board views via the `client.board_view` 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 Board Views?</span>
6
+ Board views are different ways to visualize and interact with your board data, such as main table, kanban, calendar, chart, timeline, and more.
7
+ :::
8
+
9
+ ## Methods
10
+
11
+ ### query
12
+
13
+ Retrieves views for boards.
14
+
15
+ ```ruby
16
+ client.board_view.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", "name", "type"]` | Fields to retrieve |
25
+
26
+ **Returns:** `Monday::Response`
27
+
28
+ **Common args:**
29
+ - `ids` - Array of board IDs
30
+ - `limit` - Integer - Maximum number of boards to return
31
+ - `page` - Integer - Page number for pagination
32
+
33
+ **Available Fields:**
34
+
35
+ - `id` - View ID
36
+ - `name` - View name
37
+ - `type` - View type (e.g., "BoardView", "KanbanView", "CalendarView", "TimelineView")
38
+ - `settings_str` - JSON string with view settings
39
+ - `view_specific_data_str` - JSON string with view-specific data
40
+
41
+ **View Types:**
42
+
43
+ - `BoardView` - Main table view
44
+ - `KanbanView` - Kanban board view
45
+ - `CalendarView` - Calendar view
46
+ - `TimelineView` - Timeline/Gantt view
47
+ - `ChartView` - Chart view
48
+ - `MapView` - Map view
49
+ - `FormView` - Form view
50
+ - `WorkloadView` - Workload view
51
+ - `FilesView` - Files gallery view
52
+
53
+ **Response Structure:**
54
+
55
+ Views are nested under boards:
56
+
57
+ ```ruby
58
+ boards = response.body.dig("data", "boards")
59
+ views = boards.first&.dig("views") || []
60
+ ```
61
+
62
+ **Example:**
63
+
64
+ ```ruby
65
+ require "monday_ruby"
66
+
67
+ Monday.configure do |config|
68
+ config.token = ENV["MONDAY_TOKEN"]
69
+ end
70
+
71
+ client = Monday::Client.new
72
+
73
+ response = client.board_view.query(
74
+ args: { ids: [1234567890] }
75
+ )
76
+
77
+ if response.success?
78
+ boards = response.body.dig("data", "boards")
79
+ views = boards.first&.dig("views") || []
80
+
81
+ puts "Found #{views.length} views"
82
+ views.each do |view|
83
+ puts " • #{view['name']}: #{view['type']} (ID: #{view['id']})"
84
+ end
85
+ end
86
+ ```
87
+
88
+ **Output:**
89
+ ```
90
+ Found 4 views
91
+ • Main Table: BoardView (ID: 12345)
92
+ • Kanban: KanbanView (ID: 12346)
93
+ • Calendar: CalendarView (ID: 12347)
94
+ • Timeline: TimelineView (ID: 12348)
95
+ ```
96
+
97
+ **GraphQL:** `query { boards { views { ... } } }`
98
+
99
+ **See:** [monday.com views query](https://developer.monday.com/api-reference/reference/views)
100
+
101
+ ## Query Multiple Boards
102
+
103
+ Get views from multiple boards:
104
+
105
+ ```ruby
106
+ response = client.board_view.query(
107
+ args: { ids: [1234567890, 2345678901] },
108
+ select: ["id", "name", "type"]
109
+ )
110
+
111
+ if response.success?
112
+ boards = response.body.dig("data", "boards")
113
+
114
+ boards.each do |board|
115
+ views = board["views"] || []
116
+ puts "Board #{board['id']}: #{views.length} views"
117
+
118
+ views.each do |view|
119
+ puts " • #{view['name']} (#{view['type']})"
120
+ end
121
+ end
122
+ end
123
+ ```
124
+
125
+ ## Get View Settings
126
+
127
+ Retrieve and parse view settings:
128
+
129
+ ```ruby
130
+ require "json"
131
+
132
+ response = client.board_view.query(
133
+ args: { ids: [1234567890] },
134
+ select: ["id", "name", "type", "settings_str"]
135
+ )
136
+
137
+ if response.success?
138
+ boards = response.body.dig("data", "boards")
139
+ views = boards.first&.dig("views") || []
140
+
141
+ views.each do |view|
142
+ puts "\n#{view['name']} (#{view['type']})"
143
+
144
+ if view["settings_str"]
145
+ settings = JSON.parse(view["settings_str"])
146
+ puts " Settings: #{settings.keys.join(', ')}"
147
+ end
148
+ end
149
+ end
150
+ ```
151
+
152
+ ## Filter Views by Type
153
+
154
+ Find all views of a specific type:
155
+
156
+ ```ruby
157
+ def find_views_by_type(client, board_id, view_type)
158
+ response = client.board_view.query(
159
+ args: { ids: [board_id] },
160
+ select: ["id", "name", "type"]
161
+ )
162
+
163
+ return [] unless response.success?
164
+
165
+ boards = response.body.dig("data", "boards")
166
+ views = boards.first&.dig("views") || []
167
+
168
+ views.select { |view| view["type"] == view_type }
169
+ end
170
+
171
+ # Usage
172
+ kanban_views = find_views_by_type(client, 1234567890, "KanbanView")
173
+
174
+ puts "Kanban Views: #{kanban_views.length}"
175
+ kanban_views.each do |view|
176
+ puts " • #{view['name']} (ID: #{view['id']})"
177
+ end
178
+ ```
179
+
180
+ ## List All View Types
181
+
182
+ Get an overview of all view types on a board:
183
+
184
+ ```ruby
185
+ response = client.board_view.query(
186
+ args: { ids: [1234567890] },
187
+ select: ["id", "name", "type"]
188
+ )
189
+
190
+ if response.success?
191
+ boards = response.body.dig("data", "boards")
192
+ views = boards.first&.dig("views") || []
193
+
194
+ by_type = views.group_by { |view| view["type"] }
195
+
196
+ puts "View Types:"
197
+ by_type.each do |type, views_of_type|
198
+ puts " #{type}: #{views_of_type.length} view(s)"
199
+ end
200
+ end
201
+ ```
202
+
203
+ **Output:**
204
+ ```
205
+ View Types:
206
+ BoardView: 1 view(s)
207
+ KanbanView: 2 view(s)
208
+ CalendarView: 1 view(s)
209
+ TimelineView: 1 view(s)
210
+ ```
211
+
212
+ ## Response Structure
213
+
214
+ All methods return a `Monday::Response` object. Access data using:
215
+
216
+ ```ruby
217
+ response.success? # => true/false
218
+ response.status # => 200
219
+ response.body # => Hash with GraphQL response
220
+ ```
221
+
222
+ ### Typical Response Pattern
223
+
224
+ ```ruby
225
+ response = client.board_view.query(
226
+ args: { ids: [1234567890] }
227
+ )
228
+
229
+ if response.success?
230
+ boards = response.body.dig("data", "boards")
231
+ views = boards.first&.dig("views") || []
232
+
233
+ # Work with views
234
+ else
235
+ # Handle error
236
+ end
237
+ ```
238
+
239
+ ## Constants
240
+
241
+ ### DEFAULT_SELECT
242
+
243
+ Default fields returned by the board view query:
244
+
245
+ ```ruby
246
+ ["id", "name", "type"]
247
+ ```
248
+
249
+ ## Error Handling
250
+
251
+ Common errors when working with board views:
252
+
253
+ - `Monday::AuthorizationError` - Invalid or missing API token
254
+ - `Monday::InvalidRequestError` - Invalid board ID
255
+ - `Monday::Error` - Invalid field or other API errors
256
+
257
+ **Example:**
258
+
259
+ ```ruby
260
+ begin
261
+ response = client.board_view.query(
262
+ args: { ids: [123] } # Invalid ID
263
+ )
264
+ rescue Monday::InvalidRequestError => e
265
+ puts "Error: #{e.message}"
266
+ end
267
+ ```
268
+
269
+ See the [Error Handling guide](/guides/advanced/errors) for more details.
270
+
271
+ ## Use Cases
272
+
273
+ ### Check Available Views
274
+
275
+ See what views are available on a board:
276
+
277
+ ```ruby
278
+ response = client.board_view.query(
279
+ args: { ids: [1234567890] },
280
+ select: ["id", "name", "type"]
281
+ )
282
+
283
+ if response.success?
284
+ boards = response.body.dig("data", "boards")
285
+ views = boards.first&.dig("views") || []
286
+
287
+ puts "Available Views:"
288
+ views.each do |view|
289
+ puts " • #{view['name']}"
290
+ end
291
+ end
292
+ ```
293
+
294
+ ### Find Default View
295
+
296
+ Get the main table view:
297
+
298
+ ```ruby
299
+ response = client.board_view.query(
300
+ args: { ids: [1234567890] },
301
+ select: ["id", "name", "type"]
302
+ )
303
+
304
+ if response.success?
305
+ boards = response.body.dig("data", "boards")
306
+ views = boards.first&.dig("views") || []
307
+
308
+ main_view = views.find { |v| v["type"] == "BoardView" }
309
+
310
+ if main_view
311
+ puts "Main View: #{main_view['name']} (ID: #{main_view['id']})"
312
+ end
313
+ end
314
+ ```
315
+
316
+ ### Export View Information
317
+
318
+ Export view details for documentation:
319
+
320
+ ```ruby
321
+ require "csv"
322
+
323
+ def export_views_to_csv(client, board_id, filename)
324
+ response = client.board_view.query(
325
+ args: { ids: [board_id] },
326
+ select: ["id", "name", "type"]
327
+ )
328
+
329
+ return unless response.success?
330
+
331
+ boards = response.body.dig("data", "boards")
332
+ views = boards.first&.dig("views") || []
333
+
334
+ CSV.open(filename, "w") do |csv|
335
+ csv << ["ID", "Name", "Type"]
336
+
337
+ views.each do |view|
338
+ csv << [view["id"], view["name"], view["type"]]
339
+ end
340
+ end
341
+
342
+ puts "✓ Exported #{views.length} views to #{filename}"
343
+ end
344
+
345
+ # Usage
346
+ export_views_to_csv(client, 1234567890, "board_views.csv")
347
+ ```
348
+
349
+ ## Related Resources
350
+
351
+ - [Board](/reference/resources/board) - Boards containing views
352
+ - [Item](/reference/resources/item) - Items displayed in views
353
+ - [Column](/reference/resources/column) - Columns shown in views
354
+
355
+ ## External References
356
+
357
+ - [monday.com Views API](https://developer.monday.com/api-reference/reference/views)
358
+ - [GraphQL API Overview](https://developer.monday.com/api-reference/docs/introduction-to-graphql)
359
+ - [View Types](https://support.monday.com/hc/en-us/articles/115005571189-An-Overview-of-monday-com-Views)