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

[BUG]: missing route /orgs/:org/repos #595

Open
1 task done
helaili opened this issue Dec 2, 2024 · 3 comments
Open
1 task done

[BUG]: missing route /orgs/:org/repos #595

helaili opened this issue Dec 2, 2024 · 3 comments
Labels
Status: Triage This is being looked at and prioritized Type: Bug Something isn't working as documented

Comments

@helaili
Copy link

helaili commented Dec 2, 2024

What happened?

The /orgs/{org}/repos route accepts an additional internal repository visibility on top of public and internal. The generated typescript type is currently public | private | undefined and doesn't allow internal.

Versions

@octokit/plugin-enterprise-cloud: 13.0.0
Node: v20.11.0

Relevant log output

Code of Conduct

  • I agree to follow this project's Code of Conduct
@helaili helaili added Status: Triage This is being looked at and prioritized Type: Bug Something isn't working as documented labels Dec 2, 2024
Copy link
Contributor

github-actions bot commented Dec 2, 2024

👋 Hi! Thank you for this contribution! Just to let you know, our GitHub SDK team does a round of issue and PR reviews twice a week, every Monday and Friday! We have a process in place for prioritizing and responding to your input. Because you are a part of this community please feel free to comment, add to, or pick up any issues/PRs that are labeled with Status: Up for grabs. You & others like you are the reason all of this works! So thank you & happy coding! 🚀

@wolfy1339
Copy link
Member

there aren't any types exported for the GHEC methods yet.

The types that are used are for GitHub.com

See #565 for an attempt at adding types

@nickfloyd nickfloyd moved this from 🆕 Triage to 🔥 Backlog in 🧰 Octokit Active Dec 23, 2024
@ataylorme
Copy link

I am having to do very hacky things to work around this. Here is an example in case it helps anyone else:

import type {Endpoints as GitHubApiEndpointsType} from '@octokit/types';
import type {operations as GhecOperations} from '@octokit/openapi-types-ghec';

type RepositoryVisibility = GhecOperations['repos/create-in-org']['requestBody']['content']['application/json']['visibility'];

type createRepoParametersType = Omit<GitHubApiEndpointsType['POST /orgs/{org}/repos']['parameters'], 'visibility'> & {
	visibility: RepositoryVisibility;
};

type createRepoResponseType = GitHubApiEndpointsType['POST /orgs/{org}/repos']['response']['data'];

export default async function createRepo(parameters: createRepoParametersType): Promise<createRepoResponseType>{
  // Octokit initialization here
  return octokit.request('POST /orgs/{org}/repos', parameters as GitHubApiEndpointsType['POST /orgs/{org}/repos']['parameters'])
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Triage This is being looked at and prioritized Type: Bug Something isn't working as documented
Projects
Status: 🔥 Backlog
Development

No branches or pull requests

3 participants