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

Tags order_by parameter does not allow the "version" value added in GitLab 15.4 #3664

Open
2 tasks done
alexdmccabe opened this issue Dec 4, 2024 · 0 comments
Open
2 tasks done

Comments

@alexdmccabe
Copy link

alexdmccabe commented Dec 4, 2024

Description

  • Node.js version: v20.17.0
  • Gitbeaker version: 41.3.0
  • Gitbeaker release (cli, rest, core, requester-utils): core / rest
  • OS & version: Fedora Linux 40

The Tags API added version as an allowed value for the `order_by_ parameter in GitLab 15.4, but it is not listed as an allowed value in this package.

TS2322: Type "version" is not assignable to type "name" | "updated"

Screenshot of a pop-up modal in JetBrains WebStorm IDE, displaying error TS2322 about "version" being passed as a value to the "orderBy" property of the GitLab Tags API.

https://docs.gitlab.com/ee/api/tags.html

History
version value for the order_by attribute introduced in GitLab 15.4.

https://gitlab.com/gitlab-org/gitlab/-/merge_requests/95150

Steps to reproduce

import {
  Gitlab,
} from '@gitbeaker/core';

const gitlab = new Gitlab({
  host: 'example.com',
});

const tags = gitlab.Tags.all(
  'example/project-id',
  {
    orderBy: 'version',
  },
);

Expected behaviour

The orderBy option should allow version.

Actual behaviour

The orderBy option does not allow version.

Possible fixes

Add version to the allowed values, which I think (not 100% sure, though) would be done here: https://github.com/jdalrymple/gitbeaker/blob/main/packages/core/src/resources/Tags.ts#L45

Checklist

  • I have checked that this is not a duplicate issue.
  • I have read the documentation.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant