Skip to content

apiKeys.list() should return a PageIterator wrapped response #958

Description

@humphd

I'm updating my app from a previous version to 1.2.103 and I notice you now support pagination in the SDK (nice!). I'm trying to replace a bunch of custom pagination code with this:

      const response = await this.client.apiKeys.list({
        includeDisabled,
        workspaceId: this.workspaceId,
      });

      for await (const page of response /* <-- this fails */) {
        allKeys.push(...page);
      }

I'm getting this TS error:

Type 'ListResponse' must have a 'Symbol.asyncIterator' method that returns an async iterator.

If I try what I see in the docs, and do the same thing with byok.list() it works, since the latter is returning a response wrapped in PageIterator. Can we get pagination on apiKeys too?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions