javascript icon indicating copy to clipboard operation
javascript copied to clipboard

Incorrect Return Type for getAllowlistIdentifierList

Open mario-jerkovic opened this issue 1 year ago • 2 comments

Preliminary Checks

  • [X] I have reviewed the documentation: https://clerk.com/docs

  • [X] I have searched for existing issues: https://github.com/clerk/javascript/issues

  • [X] I have not already reached out to Clerk support via email or Discord (if you have, no need to open an issue here)

  • [X] This issue is not a question, general help request, or anything other than a bug report directly related to Clerk. Please ask questions in our Discord community: https://clerk.com/discord.

Reproduction

https://github.com/mario-jerkovic/clerk-nodejs.git

Publishable key

pk_test_dHJ1ZS1zaGVlcGRvZy04Ni5jbGVyay5hY2NvdW50cy5kZXYk

Description

The getAllowlistIdentifierList method in the @clerk/clerk-sdk-node package is documented to return a PaginatedResourceResponse<AllowlistIdentifier> type.

However, in practice, it returns an AllowlistIdentifier[]. This discrepancy causes issues when attempting to work with pagination as the expected metadata for handling paginated data is absent.

https://github.com/clerk/javascript/assets/16222284/325ff6db-927b-4dbb-a4ee-3b8d453f7c68

Environment

System:
    OS: macOS 14.4.1
    CPU: (8) arm64 Apple M1 Pro
    Memory: 181.75 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.12.2 - ~/.nvm/versions/node/v20.12.2/bin/node
    Yarn: 1.22.22 - ~/.nvm/versions/node/v20.12.2/bin/yarn
    npm: 10.5.0 - ~/.nvm/versions/node/v20.12.2/bin/npm
    bun: 1.1.4 - /opt/homebrew/bin/bun
  Browsers:
    Chrome: 124.0.6367.79
    Safari: 17.4.1
  npmPackages:
    @clerk/clerk-sdk-node: ^5.0.1 => 5.0.1 
    @clerk/types: ^4.1.0 => 4.1.0 
    dotenv: ^16.4.5 => 16.4.5 
    ts-node: ^10.9.2 => 10.9.2 
    typescript: ^5.4.5 => 5.4.5

mario-jerkovic avatar Apr 26 '24 10:04 mario-jerkovic

FYI, getInvitationList has the exact same issue

danilofuchs avatar Apr 26 '24 15:04 danilofuchs

Just encountered the same issue with getUserOauthAccessToken

doei avatar Apr 27 '24 08:04 doei

A fix for these issues is being worked on here: https://github.com/clerk/javascript/pull/3276

LekoArts avatar Apr 29 '24 07:04 LekoArts