Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get Token from a newly create DeployToken #3655

Open
kingmesal opened this issue Nov 15, 2024 · 1 comment
Open

Get Token from a newly create DeployToken #3655

kingmesal opened this issue Nov 15, 2024 · 1 comment
Labels
type:types Adding or enhancing typescript types

Comments

@kingmesal
Copy link

Description

I've checked the api docs: https://docs.gitlab.com/ee/api/deploy_tokens.html#create-a-project-deploy-token and it shows the create project deploy token returns:

{
  "id": 1,
  "name": "My deploy token",
  "username": "custom-user",
  "expires_at": "2021-01-01T00:00:00.000Z",
  "token": "jMRvtPNxrn3crTAGukpZ",
  "revoked": false,
  "expired": false,
  "scopes": [
    "read_repository"
  ]
}

This api: api.DeployTokens.create(name, scopes, { projectId, expires_at: expiresAt });
Returns:

interface DeployTokenSchema extends Record<string, unknown> {
    id: number;
    name: string;
    username: string;
    expires_at: string;
    revoked: boolean;
    expired: boolean;
    scopes?: DeployTokenScope[];
}

Where is the token field?

Side note, I noticed that this API was just recently expanded, so thanks for that!

@jdalrymple
Copy link
Owner

Probably just missed it in the type! EZ fix

@jdalrymple jdalrymple added type:types Adding or enhancing typescript types and removed question labels Nov 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:types Adding or enhancing typescript types
Projects
None yet
Development

No branches or pull requests

2 participants