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,393 @@
1
+ # Board
2
+
3
+ Access and manage boards via the `client.board` resource.
4
+
5
+ ## Methods
6
+
7
+ ### query
8
+
9
+ Retrieves boards from your account.
10
+
11
+ ```ruby
12
+ client.board.query(args: {}, select: DEFAULT_SELECT)
13
+ ```
14
+
15
+ **Parameters:**
16
+
17
+ | Name | Type | Default | Description |
18
+ |------|------|---------|-------------|
19
+ | `args` | Hash | `{}` | Query arguments (see [boards query](https://developer.monday.com/api-reference/reference/boards#queries)) |
20
+ | `select` | Array | `["id", "name", "description"]` | Fields to retrieve |
21
+
22
+ **Returns:** `Monday::Response`
23
+
24
+ **Common args:**
25
+ - `ids` - Array of board IDs
26
+ - `limit` - Number of results (default: 25)
27
+ - `page` - Page number
28
+ - `state` - `:active`, `:archived`, `:deleted`, or `:all`
29
+ - `board_kind` - `:public`, `:private`, or `:share`
30
+ - `workspace_ids` - Array of workspace IDs
31
+ - `order_by` - `:created_at` or `:used_at`
32
+
33
+ **Example:**
34
+
35
+ ```ruby
36
+ response = client.board.query(
37
+ args: { ids: [123, 456], state: :active },
38
+ select: ["id", "name", "url"]
39
+ )
40
+
41
+ boards = response.body.dig("data", "boards")
42
+ ```
43
+
44
+ **GraphQL:** `query { boards { ... } }`
45
+
46
+ **See:** [monday.com boards query](https://developer.monday.com/api-reference/reference/boards#queries)
47
+
48
+ ### create
49
+
50
+ Creates a new board.
51
+
52
+ ```ruby
53
+ client.board.create(args: {}, select: DEFAULT_SELECT)
54
+ ```
55
+
56
+ **Parameters:**
57
+
58
+ | Name | Type | Default | Description |
59
+ |------|------|---------|-------------|
60
+ | `args` | Hash | `{}` | Creation arguments (required) |
61
+ | `select` | Array | `["id", "name", "description"]` | Fields to retrieve |
62
+
63
+ **Required args:**
64
+ - `board_name` - String
65
+ - `board_kind` - Symbol (`:public`, `:private`, or `:share`)
66
+
67
+ **Optional args:**
68
+ - `description` - String
69
+ - `workspace_id` - Integer
70
+ - `folder_id` - Integer
71
+ - `template_id` - Integer
72
+
73
+ **Returns:** `Monday::Response`
74
+
75
+ **Example:**
76
+
77
+ ```ruby
78
+ response = client.board.create(
79
+ args: {
80
+ board_name: "New Board",
81
+ board_kind: :public
82
+ }
83
+ )
84
+
85
+ board = response.body.dig("data", "create_board")
86
+ ```
87
+
88
+ **GraphQL:** `mutation { create_board { ... } }`
89
+
90
+ **See:** [monday.com create_board](https://developer.monday.com/api-reference/reference/boards#create-board)
91
+
92
+ ### update
93
+
94
+ Updates a board's attributes.
95
+
96
+ ```ruby
97
+ client.board.update(args: {})
98
+ ```
99
+
100
+ **Parameters:**
101
+
102
+ | Name | Type | Default | Description |
103
+ |------|------|---------|-------------|
104
+ | `args` | Hash | `{}` | Update arguments (required) |
105
+
106
+ **Required args:**
107
+ - `board_id` - Integer
108
+ - `board_attribute` - Symbol (`:name`, `:description`, or `:communication`)
109
+ - `new_value` - String
110
+
111
+ **Returns:** `Monday::Response`
112
+
113
+ The response body contains a JSON string at `response.body["data"]["update_board"]` that must be parsed:
114
+
115
+ ```ruby
116
+ result = JSON.parse(response.body["data"]["update_board"])
117
+ # => { "success" => true, "undo_data" => "..." }
118
+ ```
119
+
120
+ **Example:**
121
+
122
+ ```ruby
123
+ response = client.board.update(
124
+ args: {
125
+ board_id: 123,
126
+ board_attribute: :name,
127
+ new_value: "Updated Name"
128
+ }
129
+ )
130
+
131
+ result = JSON.parse(response.body["data"]["update_board"])
132
+ ```
133
+
134
+ **GraphQL:** `mutation { update_board { ... } }`
135
+
136
+ **See:** [monday.com update_board](https://developer.monday.com/api-reference/reference/boards#update-board)
137
+
138
+ ### duplicate
139
+
140
+ Duplicates an existing board.
141
+
142
+ ```ruby
143
+ client.board.duplicate(args: {}, select: DEFAULT_SELECT)
144
+ ```
145
+
146
+ **Parameters:**
147
+
148
+ | Name | Type | Default | Description |
149
+ |------|------|---------|-------------|
150
+ | `args` | Hash | `{}` | Duplication arguments (required) |
151
+ | `select` | Array | `["id", "name", "description"]` | Fields to retrieve |
152
+
153
+ **Required args:**
154
+ - `board_id` - Integer
155
+ - `duplicate_type` - Symbol
156
+
157
+ **Duplicate types:**
158
+ - `:duplicate_board_with_structure` - Structure only
159
+ - `:duplicate_board_with_pulses` - Structure + items
160
+ - `:duplicate_board_with_pulses_and_updates` - Structure + items + updates
161
+
162
+ **Optional args:**
163
+ - `board_name` - String
164
+ - `workspace_id` - Integer
165
+ - `folder_id` - Integer
166
+ - `keep_subscribers` - Boolean
167
+
168
+ **Returns:** `Monday::Response`
169
+
170
+ The duplicated board is nested under `board`:
171
+
172
+ ```ruby
173
+ board = response.body.dig("data", "duplicate_board", "board")
174
+ ```
175
+
176
+ **Example:**
177
+
178
+ ```ruby
179
+ response = client.board.duplicate(
180
+ args: {
181
+ board_id: 123,
182
+ duplicate_type: :duplicate_board_with_structure
183
+ }
184
+ )
185
+
186
+ board = response.body.dig("data", "duplicate_board", "board")
187
+ ```
188
+
189
+ **GraphQL:** `mutation { duplicate_board { board { ... } } }`
190
+
191
+ **See:** [monday.com duplicate_board](https://developer.monday.com/api-reference/reference/boards#duplicate-board)
192
+
193
+ ### archive
194
+
195
+ Archives a board.
196
+
197
+ ```ruby
198
+ client.board.archive(board_id, select: ["id"])
199
+ ```
200
+
201
+ **Parameters:**
202
+
203
+ | Name | Type | Default | Description |
204
+ |------|------|---------|-------------|
205
+ | `board_id` | Integer | - | Board ID to archive (required) |
206
+ | `select` | Array | `["id"]` | Fields to retrieve |
207
+
208
+ **Returns:** `Monday::Response`
209
+
210
+ **Example:**
211
+
212
+ ```ruby
213
+ response = client.board.archive(123)
214
+
215
+ board = response.body.dig("data", "archive_board")
216
+ ```
217
+
218
+ **GraphQL:** `mutation { archive_board { ... } }`
219
+
220
+ **See:** [monday.com archive_board](https://developer.monday.com/api-reference/reference/boards#archive-board)
221
+
222
+ ### delete
223
+
224
+ Permanently deletes a board.
225
+
226
+ ```ruby
227
+ client.board.delete(board_id, select: ["id"])
228
+ ```
229
+
230
+ **Parameters:**
231
+
232
+ | Name | Type | Default | Description |
233
+ |------|------|---------|-------------|
234
+ | `board_id` | Integer | - | Board ID to delete (required) |
235
+ | `select` | Array | `["id"]` | Fields to retrieve |
236
+
237
+ **Returns:** `Monday::Response`
238
+
239
+ ::: 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>
240
+ This operation cannot be undone. All board data will be permanently lost.
241
+ :::
242
+
243
+ **Example:**
244
+
245
+ ```ruby
246
+ response = client.board.delete(123)
247
+
248
+ board = response.body.dig("data", "delete_board")
249
+ ```
250
+
251
+ **GraphQL:** `mutation { delete_board { ... } }`
252
+
253
+ **See:** [monday.com delete_board](https://developer.monday.com/api-reference/reference/boards#delete-board)
254
+
255
+ ### items_page
256
+
257
+ Retrieves paginated items from a board using cursor-based pagination.
258
+
259
+ ```ruby
260
+ client.board.items_page(
261
+ board_ids:,
262
+ limit: 25,
263
+ cursor: nil,
264
+ query_params: nil,
265
+ select: DEFAULT_PAGINATED_SELECT
266
+ )
267
+ ```
268
+
269
+ **Parameters:**
270
+
271
+ | Name | Type | Default | Description |
272
+ |------|------|---------|-------------|
273
+ | `board_ids` | Integer or Array | - | Board ID(s) to query (required) |
274
+ | `limit` | Integer | `25` | Items per page (max: 500) |
275
+ | `cursor` | String | `nil` | Pagination cursor |
276
+ | `query_params` | Hash | `nil` | Query filters with rules and operators |
277
+ | `select` | Array | `["id", "name"]` | Item fields to retrieve |
278
+
279
+ **Returns:** `Monday::Response`
280
+
281
+ The response contains items and cursor:
282
+
283
+ ```ruby
284
+ items_page = response.body.dig("data", "boards", 0, "items_page")
285
+ items = items_page["items"]
286
+ cursor = items_page["cursor"]
287
+ ```
288
+
289
+ **Example:**
290
+
291
+ ```ruby
292
+ # First page
293
+ response = client.board.items_page(
294
+ board_ids: 123,
295
+ limit: 50
296
+ )
297
+
298
+ items_page = response.body.dig("data", "boards", 0, "items_page")
299
+ cursor = items_page["cursor"]
300
+
301
+ # Next page
302
+ response = client.board.items_page(
303
+ board_ids: 123,
304
+ cursor: cursor
305
+ )
306
+ ```
307
+
308
+ **GraphQL:** `query { boards { items_page { ... } } }`
309
+
310
+ **See:**
311
+ - [monday.com items_page](https://developer.monday.com/api-reference/reference/items-page)
312
+ - [Pagination guide](/guides/advanced/pagination)
313
+
314
+ ### delete_subscribers
315
+
316
+ ::: 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>
317
+ This method is deprecated and will be removed in v2.0.0. Use `client.user.delete_from_board` instead.
318
+ :::
319
+
320
+ Deletes subscribers from a board.
321
+
322
+ ```ruby
323
+ client.board.delete_subscribers(board_id, user_ids, select: ["id"])
324
+ ```
325
+
326
+ **Parameters:**
327
+
328
+ | Name | Type | Default | Description |
329
+ |------|------|---------|-------------|
330
+ | `board_id` | Integer | - | Board ID (required) |
331
+ | `user_ids` | Integer[] | - | User IDs to remove (required) |
332
+ | `select` | Array | `["id"]` | Fields to retrieve | -->
333
+
334
+ **Returns:** `Monday::Response`
335
+
336
+ **GraphQL:** `mutation { delete_subscribers_from_board { ... } }`
337
+
338
+ ## Response Structure
339
+
340
+ All methods return a `Monday::Response` object. Access data using:
341
+
342
+ ```ruby
343
+ response.success? # => true/false
344
+ response.status # => 200
345
+ response.body # => Hash with GraphQL response
346
+ ```
347
+
348
+ ### Typical Response Pattern
349
+
350
+ ```ruby
351
+ response = client.board.query(args: { ids: [123] })
352
+
353
+ if response.success?
354
+ boards = response.body.dig("data", "boards")
355
+ # Work with boards
356
+ else
357
+ # Handle error
358
+ end
359
+ ```
360
+
361
+ ## Constants
362
+
363
+ ### DEFAULT_SELECT
364
+
365
+ Default fields returned by `query`, `create`, and `duplicate`:
366
+
367
+ ```ruby
368
+ ["id", "name", "description"]
369
+ ```
370
+
371
+ ### DEFAULT_PAGINATED_SELECT
372
+
373
+ Default fields returned by `items_page`:
374
+
375
+ ```ruby
376
+ ["id", "name"]
377
+ ```
378
+
379
+ ## Error Handling
380
+
381
+ See the [Error Handling guide](/guides/advanced/errors) for common errors and how to handle them.
382
+
383
+ ## Related Resources
384
+
385
+ - [Item](/reference/resources/item) - Board items
386
+ - [Column](/reference/resources/column) - Board columns
387
+ - [Group](/reference/resources/group) - Board groups
388
+ - [Workspace](/reference/resources/workspace) - Board workspaces
389
+
390
+ ## External References
391
+
392
+ - [monday.com Boards API](https://developer.monday.com/api-reference/reference/boards)
393
+ - [GraphQL API Overview](https://developer.monday.com/api-reference/docs/introduction-to-graphql)