Skip to content

Commit eac5b8b

Browse files
committed
refactor: Name the paginated request type SeamPaginatedRequest
A bare boolean type argument in createPaginator's signature was opaque. Express the pagination gate through an exported SeamPaginatedRequest alias, used by createPaginator, SeamPaginator, and the generated request types of paginated endpoints, so signatures read as intent while non-paginated requests remain a compile error. Also merges main. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01B8xeJm2Hd923k8uo6eoFd2
1 parent f6c000c commit eac5b8b

49 files changed

Lines changed: 267 additions & 145 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

codegen/layouts/partials/route-class-endpoint-export.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export type {{parametersTypeName}} = {{#if requiresAtLeastOneParameter}}RequireA
55
*/
66
export type {{responseTypeName}} = {{#if returnsVoid}}void{{else}}{ {{json responseKey}}: {{#if responseIsList}}Array<{{responseResourceTypeName}}>{{else}}{{responseResourceTypeName}}{{/if}} }{{/if}}
77

8-
export type {{requestTypeName}} = SeamHttpRequest<{{#if returnsVoid}}void, undefined{{else}}{{responseTypeName}}, '{{responseKey}}'{{/if}}{{#if hasPagination}}, true{{/if}}>
8+
export type {{requestTypeName}} = {{#if hasPagination}}SeamPaginatedRequest<{{responseTypeName}}, '{{responseKey}}'>{{else}}SeamHttpRequest<{{#if returnsVoid}}void, undefined{{else}}{{responseTypeName}}, '{{responseKey}}'{{/if}}>{{/if}}
99

1010

1111
{{#if returnsActionAttempt}}

codegen/layouts/partials/route-class-methods.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ static fromPersonalAccessToken(
9898
}
9999

100100
createPaginator<const TResponse, const TResponseKey extends keyof TResponse>(
101-
request: SeamHttpRequest<TResponse, TResponseKey, true>,
101+
request: SeamPaginatedRequest<TResponse, TResponseKey>,
102102
): SeamPaginator<TResponse, TResponseKey> {
103103
return new SeamPaginator<TResponse, TResponseKey>(this, request)
104104
}

codegen/layouts/partials/route-imports.hbs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,10 @@ import {
3131
limitToSeamHttpRequestOptions,
3232
parseOptions
3333
} from 'lib/parse-options.js'
34-
import { SeamHttpRequest } from 'lib/seam-http-request.js'
34+
import {
35+
type SeamPaginatedRequest,
36+
SeamHttpRequest
37+
} from 'lib/seam-http-request.js'
3538
import { SeamPaginator } from 'lib/seam-paginator.js'
3639

3740
{{#if needsActionAttemptsImport}}

src/lib/routes/access-codes/access-codes.ts

Lines changed: 7 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/lib/routes/access-codes/simulate/simulate.ts

Lines changed: 5 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/lib/routes/access-codes/unmanaged/unmanaged.ts

Lines changed: 7 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/lib/routes/access-grants/access-grants.ts

Lines changed: 7 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/lib/routes/access-grants/unmanaged/unmanaged.ts

Lines changed: 7 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/lib/routes/access-methods/access-methods.ts

Lines changed: 7 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/lib/routes/access-methods/unmanaged/unmanaged.ts

Lines changed: 5 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)