Commit 92026d6
authored
Add pagination to all SDK list methods (breaking, 0.4.0) (#173)
* Add wrapped pagination trait and timesheet pagination to Smithy spec
Add `key` field to `basecampPagination` trait for wrapped-object pagination
(responses like `{person, events}` where paginated items are nested under a
key rather than returned as a bare array).
Mark GetProjectTimesheet and GetRecordingTimesheet as paginated. Fix
GetPersonProgress URI to include `.json` suffix via enhance-openapi script.
Regenerate openapi.json, client.gen.go, and behavior-model.json.
* Add wrapped pagination support to all SDK generators and runtimes
Each SDK gains the ability to paginate responses where items are nested
inside a wrapper object (e.g. `{person: {...}, events: [...]}`) rather
than returned as a bare array.
Ruby: `paginate_wrapped` helper + `wrap_paginated_wrapped` hook wrapper
that fires on_operation_start eagerly and on_operation_end when the lazy
Enumerator completes.
TypeScript: `requestPaginatedWrapped<K, TItem>` method preserving wrapper
fields alongside a `ListResult<TItem>` for the paginated key.
Swift: `requestPaginated` overload accepting `itemsKey` parameter to
extract items from wrapped responses.
Kotlin: Generator emits custom `parseItems` lambda extracting items from
the wrapper object's key.
All four generators updated to read `x-basecamp-pagination.key` and route
to the wrapped pagination path.
* Regenerate SDK services and add wrapped pagination tests
Regenerate Ruby, TypeScript, Swift, and Kotlin services from updated
OpenAPI spec. PersonProgress now uses wrapped pagination (key: "events"),
and timesheet for_project/for_recording are now paginated.
Add multi-page wrapped pagination tests exercising the full
person→events accumulation path in all five SDKs (Go test in next
commit). Each test verifies wrapper fields (person) are preserved while
events paginate across Link-header pages.
* Add pagination support to all Go SDK list methods
21 list methods previously returned only page 1. Each now accepts
optional list options (Limit, Page) and follows Link-header pagination
via followPagination, returning *ListResult with TotalCount and Truncated
metadata.
Group A (12 methods): webhooks, client approvals/correspondences/replies,
templates, campfires, campfire lines/uploads, boosts, todolist groups,
message types — gain ListOptions parameter and followPagination.
Group B (7 methods): progress, project timeline, person progress, search,
pingable people, vault versions, chatbots — gain result wrapper types.
Group C (2 methods): project/recording timesheet reports — gain
pagination on existing TimesheetReportOptions.
PersonProgress uses a custom wrapped pagination loop since each page
returns {person, events} rather than a bare array. Includes multi-page
wrapped pagination tests.
BREAKING: All 21 methods have new signatures (added opts parameter
and/or changed return types). Callers pass nil for default behavior.
* Update conformance runners and bump version to 0.4.0
Adapt Go, Ruby, and TypeScript conformance runners for new pagination
signatures. Update paths.json for .json-suffixed person progress route.
Bump version to 0.4.0 across Go, Ruby, and root package.json to reflect
breaking pagination API changes.
* Tighten timeline limit contract and add missing test coverage
Fix doc/code mismatch: docs said "Use -1 for unlimited" but code treats
any negative value as unlimited. Update all three method docs to say
"negative = unlimited" matching the actual behavior.
Add default-cap (Limit:0 and nil with >100 items) and unlimited tests
for ProjectTimeline and PersonProgress, achieving symmetric test coverage
across all three timeline entrypoints.
* Address bot review findings
- Add missing negative-remaining guard in wrappedPaginationHandler test
helper, matching the other two pagination handlers
- Normalize negative Limit in ListChatbots to match all other list
methods (was passing raw negative value through)
- Fix Kotlin generator trailing comma no-op: else branch now emits ""
instead of "," for last property in data class
- Update Page field docs from "non-zero" to "positive" across all files
changed in this PR, matching the actual `> 0` check
- Regenerate Kotlin services (fixes trailing comma in PersonProgressResult)
* Sanitize log output in conformance runner to fix CodeQL alert
Strip newlines from test result messages before printing to prevent
log injection (go/log-injection). Pre-existing code newly flagged
by CodeQL due to surrounding changes.
* Revert stale Upload.kt width/height Double back to Int
The Kotlin generator produces Int (matching openapi.json type: integer).
The Double was from a stale regeneration and doesn't match the spec.1 parent 5834bd8 commit 92026d6
78 files changed
Lines changed: 3632 additions & 489 deletions
File tree
- conformance
- runner
- go
- ruby
- typescript
- tests
- go/pkg
- basecamp
- generated
- kotlin
- generator/src/main/kotlin/com/basecamp/sdk/generator
- sdk
- src
- commonMain/kotlin/com/basecamp/sdk
- generated
- models
- services
- services
- commonTest/kotlin/com/basecamp/sdk
- ruby
- lib/basecamp
- generated
- services
- services
- scripts
- test/basecamp/services
- scripts
- spec
- swift
- Sources
- BasecampGenerator
- Basecamp
- Generated/Services
- Services
- Tests/BasecampTests
- typescript
- scripts
- src
- generated
- services
- services
- tests/services
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
782 | 782 | | |
783 | 783 | | |
784 | 784 | | |
| 785 | + | |
| 786 | + | |
| 787 | + | |
| 788 | + | |
785 | 789 | | |
786 | 790 | | |
787 | 791 | | |
| |||
850 | 854 | | |
851 | 855 | | |
852 | 856 | | |
| 857 | + | |
| 858 | + | |
| 859 | + | |
| 860 | + | |
853 | 861 | | |
854 | 862 | | |
855 | 863 | | |
| |||
914 | 922 | | |
915 | 923 | | |
916 | 924 | | |
| 925 | + | |
| 926 | + | |
| 927 | + | |
| 928 | + | |
917 | 929 | | |
918 | 930 | | |
919 | 931 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
116 | | - | |
| 116 | + | |
| 117 | + | |
117 | 118 | | |
118 | 119 | | |
119 | 120 | | |
| |||
445 | 446 | | |
446 | 447 | | |
447 | 448 | | |
448 | | - | |
| 449 | + | |
449 | 450 | | |
450 | 451 | | |
451 | 452 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
107 | 107 | | |
108 | 108 | | |
109 | 109 | | |
110 | | - | |
| 110 | + | |
111 | 111 | | |
112 | 112 | | |
113 | 113 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
35 | | - | |
| 34 | + | |
| 35 | + | |
36 | 36 | | |
37 | 37 | | |
38 | | - | |
| 38 | + | |
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
| 44 | + | |
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
| 31 | + | |
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
60 | | - | |
| 60 | + | |
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
| |||
138 | 138 | | |
139 | 139 | | |
140 | 140 | | |
141 | | - | |
| 141 | + | |
142 | 142 | | |
143 | 143 | | |
144 | 144 | | |
| |||
0 commit comments