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,808 @@
1
+ # Migration Guide: Upgrading to v1.0.0
2
+
3
+ This guide will help you migrate from monday_ruby v0.x to v1.x. The v1.0.0 release introduces a major architectural change that improves code organization, maintainability, and developer experience.
4
+
5
+ ## Overview of Changes
6
+
7
+ Version 1.0.0 introduces a **client-resource architecture** that replaces the previous flat API design. This change provides better code organization, more consistent naming conventions, and improved maintainability for future features.
8
+
9
+ ### What Changed
10
+
11
+ - **Architecture**: Moved from a flat API with mixed-in modules to a modular resource class system
12
+ - **Method Access**: Resources are now accessed through dedicated resource objects instead of directly on the client
13
+ - **Method Names**: Resource methods are now more consistent and predictable
14
+ - **Code Organization**: Each resource is encapsulated in its own class with clear responsibilities
15
+
16
+ ### Why These Changes Were Made
17
+
18
+ The v0.x architecture had several limitations:
19
+
20
+ 1. **Poor Separation of Concerns**: All resource methods were mixed into the client class, making it bloated
21
+ 2. **Namespace Pollution**: Every resource method was directly accessible on the client, leading to potential naming conflicts
22
+ 3. **Inconsistent Naming**: Method names like `create_board`, `update_item` were inconsistent with `account` (no verb)
23
+ 4. **Difficult to Extend**: Adding new resources required modifying multiple files and careful management of method names
24
+ 5. **Testing Challenges**: Testing individual resources was difficult due to tight coupling
25
+
26
+ The new architecture solves these problems by:
27
+
28
+ - Encapsulating each resource in its own class
29
+ - Providing consistent method naming across all resources
30
+ - Enabling easier testing and maintenance
31
+ - Following Ruby best practices and modern API design patterns
32
+ - Setting a foundation for future features like pagination, filtering, and more
33
+
34
+ ## Breaking Changes
35
+
36
+ ### 1. Resource Access Pattern
37
+
38
+ The most significant change is how you access resources. All resource methods now require accessing the resource object first.
39
+
40
+ #### Before (v0.x)
41
+
42
+ ```ruby
43
+ client = Monday::Client.new(token: "your_token")
44
+
45
+ # Resources accessed directly on client
46
+ response = client.account
47
+ response = client.boards
48
+ response = client.items
49
+ ```
50
+
51
+ #### After (v1.x)
52
+
53
+ ```ruby
54
+ client = Monday::Client.new(token: "your_token")
55
+
56
+ # Resources accessed through resource objects
57
+ response = client.account.query
58
+ response = client.board.query
59
+ response = client.item.query
60
+ ```
61
+
62
+ ### 2. Method Name Changes
63
+
64
+ All resource methods have been renamed to be more consistent and predictable.
65
+
66
+ #### Account Resource
67
+
68
+ | v0.x | v1.x |
69
+ |------|------|
70
+ | `client.account` | `client.account.query` |
71
+
72
+ #### Board Resource
73
+
74
+ | v0.x | v1.x |
75
+ |------|------|
76
+ | `client.boards` | `client.board.query` |
77
+ | `client.create_board` | `client.board.create` |
78
+ | `client.update_board` | `client.board.update` |
79
+ | `client.duplicate_board` | `client.board.duplicate` |
80
+ | `client.archive_board` | `client.board.archive` |
81
+ | `client.delete_board` | `client.board.delete` |
82
+ | `client.delete_board_subscribers` | `client.board.delete_subscribers` |
83
+
84
+ #### Item Resource
85
+
86
+ | v0.x | v1.x |
87
+ |------|------|
88
+ | `client.items` | `client.item.query` |
89
+ | `client.create_item` | `client.item.create` |
90
+ | `client.duplicate_item` | `client.item.duplicate` |
91
+ | `client.clear_item_updates` | `client.item.clear_updates` |
92
+ | `client.move_item_to_group` | `client.item.move_to_group` |
93
+ | `client.archive_item` | `client.item.archive` |
94
+ | `client.delete_item` | `client.item.delete` |
95
+
96
+ #### Group Resource
97
+
98
+ | v0.x | v1.x |
99
+ |------|------|
100
+ | `client.groups` | `client.group.query` |
101
+ | `client.create_group` | `client.group.create` |
102
+ | `client.update_group` | `client.group.update` |
103
+ | `client.duplicate_group` | `client.group.duplicate` |
104
+ | `client.archive_group` | `client.group.archive` |
105
+ | `client.delete_group` | `client.group.delete` |
106
+
107
+ #### Column Resource
108
+
109
+ | v0.x | v1.x |
110
+ |------|------|
111
+ | `client.columns` | `client.column.query` |
112
+ | `client.create_column` | `client.column.create` |
113
+ | `client.change_column_metadata` | `client.column.change_metadata` |
114
+ | `client.change_column_title` | `client.column.change_title` |
115
+ | `client.change_column_value` | `client.column.change_value` |
116
+ | `client.change_multiple_column_values` | `client.column.change_multiple_values` |
117
+ | `client.delete_column` | `client.column.delete` |
118
+
119
+ #### Workspace Resource
120
+
121
+ | v0.x | v1.x |
122
+ |------|------|
123
+ | `client.workspaces` | `client.workspace.query` |
124
+ | `client.create_workspace` | `client.workspace.create` |
125
+ | `client.update_workspace` | `client.workspace.update` |
126
+ | `client.delete_workspace` | `client.workspace.delete` |
127
+
128
+ #### Update Resource
129
+
130
+ | v0.x | v1.x |
131
+ |------|------|
132
+ | `client.create_update` | `client.update.create` |
133
+ | `client.like_update` | `client.update.like` |
134
+ | `client.delete_update` | `client.update.delete` |
135
+
136
+ #### Subitem Resource
137
+
138
+ | v0.x | v1.x |
139
+ |------|------|
140
+ | `client.subitems` | `client.subitem.query` |
141
+ | `client.create_subitem` | `client.subitem.create` |
142
+
143
+ #### Board View Resource
144
+
145
+ | v0.x | v1.x |
146
+ |------|------|
147
+ | `client.board_views` | `client.board_view.query` |
148
+
149
+ #### Activity Log Resource
150
+
151
+ | v0.x | v1.x |
152
+ |------|------|
153
+ | `client.activity_logs` | `client.activity_log.query` |
154
+
155
+ #### Folder Resource
156
+
157
+ | v0.x | v1.x |
158
+ |------|------|
159
+ | `client.folders` | `client.folder.query` |
160
+ | `client.create_folder` | `client.folder.create` |
161
+ | `client.update_folder` | `client.folder.update` |
162
+ | `client.delete_folder` | `client.folder.delete` |
163
+
164
+ ## Migration Steps
165
+
166
+ ### Step 1: Update Your Gemfile
167
+
168
+ ```ruby
169
+ # Gemfile
170
+ gem 'monday_ruby', '~> 1.0'
171
+ ```
172
+
173
+ Run `bundle update monday_ruby` to install the latest version.
174
+
175
+ ### Step 2: Update Resource Access Patterns
176
+
177
+ Find all instances where you're calling client methods and update them to the new resource pattern.
178
+
179
+ **Search Pattern**: Look for `client.` followed by resource method names like `boards`, `create_board`, `items`, etc.
180
+
181
+ **Example Migration**:
182
+
183
+ ```ruby
184
+ # Before (v0.x)
185
+ client = Monday::Client.new(token: token)
186
+ boards = client.boards(args: {ids: [123, 456]})
187
+ new_board = client.create_board(args: {board_name: "My Board"})
188
+
189
+ # After (v1.x)
190
+ client = Monday::Client.new(token: token)
191
+ boards = client.board.query(args: {ids: [123, 456]})
192
+ new_board = client.board.create(args: {board_name: "My Board"})
193
+ ```
194
+
195
+ ### Step 3: Update Method Names
196
+
197
+ Change all method calls to remove the resource prefix and use the resource object instead.
198
+
199
+ ```ruby
200
+ # Before (v0.x)
201
+ client.create_item(args: {board_id: 123, item_name: "Task"})
202
+ client.update_board(args: {board_id: 456, board_name: "Updated"})
203
+ client.delete_group(group_id: 789)
204
+
205
+ # After (v1.x)
206
+ client.item.create(args: {board_id: 123, item_name: "Task"})
207
+ client.board.update(args: {board_id: 456, board_name: "Updated"})
208
+ client.group.delete(group_id: 789)
209
+ ```
210
+
211
+ ### Step 4: Test Thoroughly
212
+
213
+ After making changes:
214
+
215
+ 1. Run your test suite to ensure all API calls work correctly
216
+ 2. Test error handling to ensure exceptions are still caught properly
217
+ 3. Verify that response objects work as expected (they haven't changed)
218
+
219
+ ## Common Migration Scenarios
220
+
221
+ ### Scenario 1: Fetching and Creating Boards
222
+
223
+ ```ruby
224
+ # Before (v0.x)
225
+ client = Monday::Client.new(token: token)
226
+
227
+ # Get all boards
228
+ boards = client.boards
229
+ boards.body.dig("data", "boards")
230
+
231
+ # Create a new board
232
+ new_board = client.create_board(
233
+ args: {
234
+ board_name: "Project Tracker",
235
+ board_kind: "public"
236
+ }
237
+ )
238
+ ```
239
+
240
+ ```ruby
241
+ # After (v1.x)
242
+ client = Monday::Client.new(token: token)
243
+
244
+ # Get all boards
245
+ boards = client.board.query
246
+ boards.body.dig("data", "boards")
247
+
248
+ # Create a new board
249
+ new_board = client.board.create(
250
+ args: {
251
+ board_name: "Project Tracker",
252
+ board_kind: "public"
253
+ }
254
+ )
255
+ ```
256
+
257
+ ### Scenario 2: Working with Items
258
+
259
+ ```ruby
260
+ # Before (v0.x)
261
+ # Get items from a board
262
+ items = client.items(args: {ids: [123, 456]})
263
+
264
+ # Create a new item
265
+ new_item = client.create_item(
266
+ args: {
267
+ board_id: 789,
268
+ item_name: "New Task",
269
+ column_values: {
270
+ status: {label: "Working on it"}
271
+ }
272
+ }
273
+ )
274
+
275
+ # Move item to a different group
276
+ client.move_item_to_group(item_id: 123, group_id: "topics")
277
+ ```
278
+
279
+ ```ruby
280
+ # After (v1.x)
281
+ # Get items from a board
282
+ items = client.item.query(args: {ids: [123, 456]})
283
+
284
+ # Create a new item
285
+ new_item = client.item.create(
286
+ args: {
287
+ board_id: 789,
288
+ item_name: "New Task",
289
+ column_values: {
290
+ status: {label: "Working on it"}
291
+ }
292
+ }
293
+ )
294
+
295
+ # Move item to a different group
296
+ client.item.move_to_group(item_id: 123, group_id: "topics")
297
+ ```
298
+
299
+ ### Scenario 3: Column Value Updates
300
+
301
+ ```ruby
302
+ # Before (v0.x)
303
+ client.change_column_value(
304
+ board_id: 123,
305
+ item_id: 456,
306
+ column_id: "status",
307
+ value: {label: "Done"}
308
+ )
309
+
310
+ client.change_multiple_column_values(
311
+ board_id: 123,
312
+ item_id: 456,
313
+ column_values: {
314
+ status: {label: "Done"},
315
+ person: {personsAndTeams: [{id: 789, kind: "person"}]}
316
+ }
317
+ )
318
+ ```
319
+
320
+ ```ruby
321
+ # After (v1.x)
322
+ client.column.change_value(
323
+ board_id: 123,
324
+ item_id: 456,
325
+ column_id: "status",
326
+ value: {label: "Done"}
327
+ )
328
+
329
+ client.column.change_multiple_values(
330
+ board_id: 123,
331
+ item_id: 456,
332
+ column_values: {
333
+ status: {label: "Done"},
334
+ person: {personsAndTeams: [{id: 789, kind: "person"}]}
335
+ }
336
+ )
337
+ ```
338
+
339
+ ### Scenario 4: Workspace Management
340
+
341
+ ```ruby
342
+ # Before (v0.x)
343
+ workspaces = client.workspaces
344
+ new_workspace = client.create_workspace(args: {name: "Engineering"})
345
+ client.update_workspace(workspace_id: 123, args: {name: "Product"})
346
+ client.delete_workspace(workspace_id: 456)
347
+ ```
348
+
349
+ ```ruby
350
+ # After (v1.x)
351
+ workspaces = client.workspace.query
352
+ new_workspace = client.workspace.create(args: {name: "Engineering"})
353
+ client.workspace.update(workspace_id: 123, args: {name: "Product"})
354
+ client.workspace.delete(workspace_id: 456)
355
+ ```
356
+
357
+ ## What Stayed the Same
358
+
359
+ Several aspects of the library remain unchanged to minimize disruption:
360
+
361
+ ### 1. Configuration
362
+
363
+ Configuration works exactly the same way in both versions:
364
+
365
+ ```ruby
366
+ # Global configuration (unchanged)
367
+ Monday.configure do |config|
368
+ config.token = "your_token"
369
+ config.version = "2023-07"
370
+ end
371
+
372
+ # Client-specific configuration (unchanged)
373
+ client = Monday::Client.new(token: "your_token", version: "2023-07")
374
+ ```
375
+
376
+ ### 2. Response Objects
377
+
378
+ Response objects have the same interface:
379
+
380
+ ```ruby
381
+ response = client.board.query
382
+
383
+ response.success? # Same as before
384
+ response.body # Same as before
385
+ response.status # Same as before
386
+ ```
387
+
388
+ ### 3. Error Handling
389
+
390
+ Error handling remains identical:
391
+
392
+ ```ruby
393
+ begin
394
+ client.board.create(args: {board_name: "Test"})
395
+ rescue Monday::AuthenticationError => e
396
+ puts "Authentication failed: #{e.message}"
397
+ rescue Monday::Error => e
398
+ puts "API error: #{e.message}"
399
+ end
400
+ ```
401
+
402
+ ### 4. Method Arguments
403
+
404
+ The `args` and `select` parameters work the same way:
405
+
406
+ ```ruby
407
+ # Still uses args and select parameters
408
+ client.board.query(
409
+ args: {ids: [123, 456]},
410
+ select: ["id", "name", "description"]
411
+ )
412
+ ```
413
+
414
+ ## Common Migration Pitfalls
415
+
416
+ ### Pitfall 1: Forgetting the Resource Object
417
+
418
+ **Problem**: Calling methods directly on the client
419
+
420
+ ```ruby
421
+ # This will fail in v1.x
422
+ client.boards # NoMethodError: undefined method `boards'
423
+ ```
424
+
425
+ **Solution**: Access through the resource object
426
+
427
+ ```ruby
428
+ # Correct approach
429
+ client.board.query
430
+ ```
431
+
432
+ ### Pitfall 2: Using Old Method Names
433
+
434
+ **Problem**: Using the full method name with resource prefix
435
+
436
+ ```ruby
437
+ # This will fail in v1.x
438
+ client.board.create_board # NoMethodError
439
+ ```
440
+
441
+ **Solution**: Use the simplified method name
442
+
443
+ ```ruby
444
+ # Correct approach
445
+ client.board.create
446
+ ```
447
+
448
+ ### Pitfall 3: Inconsistent Resource Names
449
+
450
+ **Problem**: Using plural resource names
451
+
452
+ ```ruby
453
+ # This will fail in v1.x
454
+ client.boards.query # NoMethodError: undefined method `boards'
455
+ ```
456
+
457
+ **Solution**: All resources are singular
458
+
459
+ ```ruby
460
+ # Correct approach
461
+ client.board.query
462
+ client.item.query
463
+ client.group.query
464
+ ```
465
+
466
+ ### Pitfall 4: Assuming Response Format Changed
467
+
468
+ **Problem**: Trying to access response differently
469
+
470
+ ```ruby
471
+ # This still works the same way
472
+ response = client.board.query
473
+ boards = response.body.dig("data", "boards") # Unchanged
474
+ ```
475
+
476
+ **Solution**: Response objects work exactly the same as before
477
+
478
+ ## New Features in v1.x
479
+
480
+ ### v1.0.0 Features
481
+
482
+ #### Enum Support
483
+
484
+ Version 1.0.0 adds support for GraphQL enums, allowing you to use enum values in your queries:
485
+
486
+ ```ruby
487
+ # Use enums in your queries
488
+ client.board.create(
489
+ args: {
490
+ board_name: "My Board",
491
+ board_kind: :public # Can use symbols for enums
492
+ }
493
+ )
494
+ ```
495
+
496
+ #### Better Code Organization
497
+
498
+ The new architecture makes it easier to:
499
+
500
+ - Understand which methods belong to which resource
501
+ - Add new resources without affecting existing code
502
+ - Test individual resources in isolation
503
+ - Navigate the codebase
504
+
505
+ ### v1.1.0 Features
506
+
507
+ If you're migrating directly to v1.1.0, you also get these new features:
508
+
509
+ #### Cursor-Based Pagination
510
+
511
+ Efficiently retrieve large numbers of items using cursor-based pagination:
512
+
513
+ ```ruby
514
+ # Fetch items with pagination (up to 500 items per page)
515
+ response = client.board.items_page(
516
+ board_ids: 123,
517
+ limit: 100
518
+ )
519
+
520
+ items = response.body.dig("data", "boards", 0, "items_page", "items")
521
+ cursor = response.body.dig("data", "boards", 0, "items_page", "cursor")
522
+
523
+ # Fetch next page
524
+ if cursor
525
+ next_response = client.board.items_page(
526
+ board_ids: 123,
527
+ limit: 100,
528
+ cursor: cursor
529
+ )
530
+ end
531
+ ```
532
+
533
+ #### Configurable Timeouts
534
+
535
+ Configure connection and read timeouts for API requests:
536
+
537
+ ```ruby
538
+ Monday.configure do |config|
539
+ config.token = "your_token"
540
+ config.open_timeout = 10 # seconds (default: 10)
541
+ config.read_timeout = 30 # seconds (default: 30)
542
+ end
543
+
544
+ # Or per client
545
+ client = Monday::Client.new(
546
+ token: "your_token",
547
+ open_timeout: 15,
548
+ read_timeout: 45
549
+ )
550
+ ```
551
+
552
+ #### Deprecation Warning System
553
+
554
+ The library now includes a deprecation warning system to help you stay informed about upcoming changes:
555
+
556
+ ```ruby
557
+ # If you use a deprecated method, you'll see a warning:
558
+ client.board.delete_subscribers(...)
559
+ # [DEPRECATION] `delete_subscribers` is deprecated and will be removed in v2.0.0.
560
+ # Use `client.user.delete_from_board` instead.
561
+ ```
562
+
563
+ ## Benefits of Upgrading
564
+
565
+ ### 1. Future-Proof Code
566
+
567
+ The v1.x architecture is designed to support new monday.com API features with minimal breaking changes. Features like pagination, filtering, and webhooks integrate naturally into the resource pattern.
568
+
569
+ ### 2. Better Developer Experience
570
+
571
+ - **Auto-completion**: IDEs can better suggest methods when they're organized by resource
572
+ - **Documentation**: Each resource class has clear documentation of its methods
573
+ - **Consistency**: Predictable naming makes it easier to guess the correct method name
574
+
575
+ ### 3. Improved Maintainability
576
+
577
+ - **Isolated Resources**: Changes to one resource don't affect others
578
+ - **Easier Testing**: Resources can be tested independently
579
+ - **Clear Responsibilities**: Each class has a single, well-defined purpose
580
+
581
+ ### 4. Ruby Best Practices
582
+
583
+ The new architecture follows Ruby community standards and patterns, making the library more familiar to Ruby developers.
584
+
585
+ ## Timeline and Support
586
+
587
+ ### Version Support Policy
588
+
589
+ - **v0.x**: No longer actively maintained (security fixes only)
590
+ - **v1.x**: Current stable version, receives new features and bug fixes
591
+ - **v2.x**: Planned for future, will include removal of deprecated methods
592
+
593
+ ### Migration Timeframe
594
+
595
+ We recommend upgrading to v1.x as soon as possible:
596
+
597
+ - **Immediate**: Update applications under active development
598
+ - **Within 3 months**: Update production applications
599
+ - **Within 6 months**: Update all applications (before v2.0.0 deprecations)
600
+
601
+ ### Deprecation Timeline
602
+
603
+ Methods deprecated in v1.1.0 will be removed in v2.0.0:
604
+
605
+ - `client.board.delete_subscribers` - Use `client.user.delete_from_board` instead
606
+ - `client.column.column_values` - Use `client.item.query` with `column_values` select instead
607
+
608
+ ## Getting Help
609
+
610
+ ### Resources
611
+
612
+ - **Documentation**: Check the [Wiki](https://github.com/sanifhimani/monday_ruby/wiki) for detailed API documentation
613
+ - **Changelog**: See [CHANGELOG.md](https://github.com/sanifhimani/monday_ruby/blob/main/CHANGELOG.md) for all changes
614
+ - **Examples**: Browse the [examples directory](https://github.com/sanifhimani/monday_ruby/tree/main/examples) (if available)
615
+
616
+ ### Support Channels
617
+
618
+ - **Issues**: Report bugs or ask questions on [GitHub Issues](https://github.com/sanifhimani/monday_ruby/issues)
619
+ - **Discussions**: Join conversations on [GitHub Discussions](https://github.com/sanifhimani/monday_ruby/discussions)
620
+ - **Contributing**: See [CONTRIBUTING.md](https://github.com/sanifhimani/monday_ruby/blob/main/CONTRIBUTING.md) for contribution guidelines
621
+
622
+ ### Common Questions
623
+
624
+ **Q: Do I need to change my error handling?**
625
+ A: No, error handling remains exactly the same.
626
+
627
+ **Q: Will my existing response parsing code work?**
628
+ A: Yes, response objects have the same interface.
629
+
630
+ **Q: Can I upgrade incrementally?**
631
+ A: No, the v1.0.0 changes are comprehensive. We recommend upgrading all client calls at once.
632
+
633
+ **Q: How long will v0.x be supported?**
634
+ A: v0.x will receive security fixes only. We recommend migrating to v1.x as soon as possible.
635
+
636
+ **Q: Are there any performance differences?**
637
+ A: The architectural changes have minimal performance impact. Response times are virtually identical.
638
+
639
+ **Q: What if I find a bug during migration?**
640
+ A: Please report it on [GitHub Issues](https://github.com/sanifhimani/monday_ruby/issues). We'll prioritize migration-related bugs.
641
+
642
+ ## Automated Migration Tools
643
+
644
+ While we don't provide an automated migration script, you can use these search-and-replace patterns to help with the migration:
645
+
646
+ ### Using Regex Find and Replace
647
+
648
+ **Pattern 1**: Board methods
649
+ ```
650
+ Find: client\.boards\(
651
+ Replace: client.board.query(
652
+
653
+ Find: client\.create_board\(
654
+ Replace: client.board.create(
655
+
656
+ Find: client\.update_board\(
657
+ Replace: client.board.update(
658
+
659
+ Find: client\.delete_board\(
660
+ Replace: client.board.delete(
661
+
662
+ Find: client\.archive_board\(
663
+ Replace: client.board.archive(
664
+
665
+ Find: client\.duplicate_board\(
666
+ Replace: client.board.duplicate(
667
+ ```
668
+
669
+ **Pattern 2**: Item methods
670
+ ```
671
+ Find: client\.items\(
672
+ Replace: client.item.query(
673
+
674
+ Find: client\.create_item\(
675
+ Replace: client.item.create(
676
+
677
+ Find: client\.move_item_to_group\(
678
+ Replace: client.item.move_to_group(
679
+
680
+ Find: client\.clear_item_updates\(
681
+ Replace: client.item.clear_updates(
682
+ ```
683
+
684
+ **Pattern 3**: Other resources
685
+ ```
686
+ Find: client\.account\(
687
+ Replace: client.account.query(
688
+
689
+ Find: client\.workspaces\(
690
+ Replace: client.workspace.query(
691
+
692
+ Find: client\.create_workspace\(
693
+ Replace: client.workspace.create(
694
+ ```
695
+
696
+ **Important**: Always review changes manually and test thoroughly after using automated find-and-replace.
697
+
698
+ ## Example: Complete Before and After
699
+
700
+ Here's a complete example showing a typical workflow in both versions:
701
+
702
+ ### Before (v0.x)
703
+
704
+ ```ruby
705
+ require 'monday_ruby'
706
+
707
+ # Initialize client
708
+ client = Monday::Client.new(token: ENV['MONDAY_TOKEN'])
709
+
710
+ # Get account info
711
+ account = client.account
712
+ puts "Account: #{account.body.dig('data', 'users', 0, 'account', 'name')}"
713
+
714
+ # Get all boards
715
+ boards = client.boards(args: {limit: 10})
716
+ board_id = boards.body.dig('data', 'boards', 0, 'id')
717
+
718
+ # Create a new item
719
+ new_item = client.create_item(
720
+ args: {
721
+ board_id: board_id,
722
+ item_name: "New Task",
723
+ column_values: {
724
+ status: {label: "Working on it"},
725
+ date: {date: "2024-12-31"}
726
+ }
727
+ }
728
+ )
729
+
730
+ item_id = new_item.body.dig('data', 'create_item', 'id')
731
+
732
+ # Update a column value
733
+ client.change_column_value(
734
+ board_id: board_id,
735
+ item_id: item_id,
736
+ column_id: "status",
737
+ value: {label: "Done"}
738
+ )
739
+
740
+ # Create an update
741
+ client.create_update(
742
+ item_id: item_id,
743
+ args: {body: "Task completed successfully!"}
744
+ )
745
+
746
+ # Archive the item
747
+ client.archive_item(item_id: item_id)
748
+ ```
749
+
750
+ ### After (v1.x)
751
+
752
+ ```ruby
753
+ require 'monday_ruby'
754
+
755
+ # Initialize client (unchanged)
756
+ client = Monday::Client.new(token: ENV['MONDAY_TOKEN'])
757
+
758
+ # Get account info
759
+ account = client.account.query
760
+ puts "Account: #{account.body.dig('data', 'users', 0, 'account', 'name')}"
761
+
762
+ # Get all boards
763
+ boards = client.board.query(args: {limit: 10})
764
+ board_id = boards.body.dig('data', 'boards', 0, 'id')
765
+
766
+ # Create a new item
767
+ new_item = client.item.create(
768
+ args: {
769
+ board_id: board_id,
770
+ item_name: "New Task",
771
+ column_values: {
772
+ status: {label: "Working on it"},
773
+ date: {date: "2024-12-31"}
774
+ }
775
+ }
776
+ )
777
+
778
+ item_id = new_item.body.dig('data', 'create_item', 'id')
779
+
780
+ # Update a column value
781
+ client.column.change_value(
782
+ board_id: board_id,
783
+ item_id: item_id,
784
+ column_id: "status",
785
+ value: {label: "Done"}
786
+ )
787
+
788
+ # Create an update
789
+ client.update.create(
790
+ item_id: item_id,
791
+ args: {body: "Task completed successfully!"}
792
+ )
793
+
794
+ # Archive the item
795
+ client.item.archive(item_id: item_id)
796
+ ```
797
+
798
+ ## Conclusion
799
+
800
+ The migration from v0.x to v1.x requires updating how you access resources and method names, but the benefits far outweigh the effort. The new architecture provides:
801
+
802
+ - Better code organization
803
+ - More consistent API design
804
+ - Easier maintenance and testing
805
+ - Foundation for future features
806
+ - Improved developer experience
807
+
808
+ Take your time with the migration, test thoroughly, and don't hesitate to reach out for help if you encounter issues. Welcome to monday_ruby v1.x!