import * as API from "@distilled.cloud/core/api"; // AUTO-GENERATED by scripts/generate.ts from .generated-specs (specs/rest-api-description). Do not edit. import * as S from "@distilled.cloud/core/schema-lite"; import * as __L from "@distilled.cloud/core/schema-lite"; import type * as Redacted from "effect/Redacted"; import { GithubServiceErrors } from "../errors.ts"; import { paginateLink } from "../pagination.ts"; import { GithubProtocol, type GithubOpError, type GithubOpContext } from "../protocol.ts"; import * as Retry from "../retry.ts"; import * as T from "../traits.ts"; // Schema table, filled on first reach (see __S at the end). const __s: any[] = []; export type { GithubOpError, GithubOpContext }; /** Span facts shared by every operation (com.distilled.telemetry#service). */ const TELEMETRY = { system: "github-api", responseHeaders: [ { header: "x-request-id", name: "http.response.header.x-request-id", transform: "list" }, { header: "request-id", name: "http.response.header.request-id", transform: "list" }, { header: "x-github-request-id", name: "http.response.header.x-github-request-id", transform: "list", }, ], prefix: "GitHub", service: "CodeScanning", labels: "github", propagate: "w3c", } as const; export interface CommitAutofixRequest { /** The account owner of the repository. The name is not case sensitive. */ owner: string; /** The name of the repository without the `.git` extension. The name is not case sensitive. */ repo: string; /** The number that identifies an alert. You can find this at the end of the URL for a code scanning alert within GitHub, and in the `number` field in the response from the `GET /repos/{owner}/{repo}/code-scanning/alerts` operation. */ alert_number: number; /** The Git reference of target branch for the commit. Branch needs to already exist. For more information, see "[Git References](https://git-scm.com/book/en/v2/Git-Internals-Git-References)" in the Git documentation. */ target_ref?: string | undefined; /** Commit message to be used. */ message?: string | undefined; } export interface CodeScanningAutofixCommitsResponse { /** The Git reference of target branch for the commit. For more information, see "[Git References](https://git-scm.com/book/en/v2/Git-Internals-Git-References)" in the Git documentation. */ target_ref?: string | undefined; /** SHA of commit with autofix. */ sha?: string | undefined; } export interface CreateAutofixRequest { /** The account owner of the repository. The name is not case sensitive. */ owner: string; /** The name of the repository without the `.git` extension. The name is not case sensitive. */ repo: string; /** The number that identifies an alert. You can find this at the end of the URL for a code scanning alert within GitHub, and in the `number` field in the response from the `GET /repos/{owner}/{repo}/code-scanning/alerts` operation. */ alert_number: number; } /** The status of an autofix. */ export type CodeScanningAutofixStatus = "pending" | "error" | "success" | "outdated"; export interface CodeScanningAutofix { status: CodeScanningAutofixStatus; description: string | null; started_at: string; } /** The language targeted by the CodeQL query */ export type CodeScanningVariantAnalysisLanguage = | "actions" | "cpp" | "csharp" | "go" | "java" | "javascript" | "python" | "ruby" | "rust" | "swift"; /** List of repository names (in the form `owner/repo-name`) to run the query against. Precisely one property from `repositories`, `repository_lists` and `repository_owners` is required. */ export type CreateVariantAnalysisRequestRepositoriesList = Array; /** List of repository lists to run the query against. Precisely one property from `repositories`, `repository_lists` and `repository_owners` is required. */ export type CreateVariantAnalysisRequestRepositoryListsList = Array; /** List of organization or user names whose repositories the query should be run against. Precisely one property from `repositories`, `repository_lists` and `repository_owners` is required. */ export type CreateVariantAnalysisRequestRepositoryOwnersList = Array; export interface CreateVariantAnalysisRequest { /** The account owner of the repository. The name is not case sensitive. */ owner: string; /** The name of the repository without the `.git` extension. The name is not case sensitive. */ repo: string; language: CodeScanningVariantAnalysisLanguage | (string & {}); /** A Base64-encoded tarball containing a CodeQL query and all its dependencies */ query_pack: string; /** List of repository names (in the form `owner/repo-name`) to run the query against. Precisely one property from `repositories`, `repository_lists` and `repository_owners` is required. */ repositories?: CreateVariantAnalysisRequestRepositoriesList | undefined; /** List of repository lists to run the query against. Precisely one property from `repositories`, `repository_lists` and `repository_owners` is required. */ repository_lists?: CreateVariantAnalysisRequestRepositoryListsList | undefined; /** List of organization or user names whose repositories the query should be run against. Precisely one property from `repositories`, `repository_lists` and `repository_owners` is required. */ repository_owners?: CreateVariantAnalysisRequestRepositoryOwnersList | undefined; } /** A GitHub user. */ export interface SimpleUser { name?: string | null | undefined; email?: string | null | undefined; login: string; id: number; node_id: string; avatar_url: string; gravatar_id: string | null; url: string; html_url: string; followers_url: string; following_url: string; gists_url: string; starred_url: string; subscriptions_url: string; organizations_url: string; repos_url: string; events_url: string; received_events_url: string; type: string; site_admin: boolean; starred_at?: string | undefined; user_view_type?: string | undefined; } /** A GitHub repository. */ export interface SimpleRepository { /** A unique identifier of the repository. */ id: number; /** The GraphQL identifier of the repository. */ node_id: string; /** The name of the repository. */ name: string; /** The full, globally unique, name of the repository. */ full_name: string; owner: SimpleUser; /** Whether the repository is private. */ private: boolean; /** The URL to view the repository on GitHub.com. */ html_url: string; /** The repository description. */ description: string | null; /** Whether the repository is a fork. */ fork: boolean; /** The URL to get more information about the repository from the GitHub API. */ url: string; /** A template for the API URL to download the repository as an archive. */ archive_url: string; /** A template for the API URL to list the available assignees for issues in the repository. */ assignees_url: string; /** A template for the API URL to create or retrieve a raw Git blob in the repository. */ blobs_url: string; /** A template for the API URL to get information about branches in the repository. */ branches_url: string; /** A template for the API URL to get information about collaborators of the repository. */ collaborators_url: string; /** A template for the API URL to get information about comments on the repository. */ comments_url: string; /** A template for the API URL to get information about commits on the repository. */ commits_url: string; /** A template for the API URL to compare two commits or refs. */ compare_url: string; /** A template for the API URL to get the contents of the repository. */ contents_url: string; /** A template for the API URL to list the contributors to the repository. */ contributors_url: string; /** The API URL to list the deployments of the repository. */ deployments_url: string; /** The API URL to list the downloads on the repository. */ downloads_url: string; /** The API URL to list the events of the repository. */ events_url: string; /** The API URL to list the forks of the repository. */ forks_url: string; /** A template for the API URL to get information about Git commits of the repository. */ git_commits_url: string; /** A template for the API URL to get information about Git refs of the repository. */ git_refs_url: string; /** A template for the API URL to get information about Git tags of the repository. */ git_tags_url: string; /** A template for the API URL to get information about issue comments on the repository. */ issue_comment_url: string; /** A template for the API URL to get information about issue events on the repository. */ issue_events_url: string; /** A template for the API URL to get information about issues on the repository. */ issues_url: string; /** A template for the API URL to get information about deploy keys on the repository. */ keys_url: string; /** A template for the API URL to get information about labels of the repository. */ labels_url: string; /** The API URL to get information about the languages of the repository. */ languages_url: string; /** The API URL to merge branches in the repository. */ merges_url: string; /** A template for the API URL to get information about milestones of the repository. */ milestones_url: string; /** A template for the API URL to get information about notifications on the repository. */ notifications_url: string; /** A template for the API URL to get information about pull requests on the repository. */ pulls_url: string; /** A template for the API URL to get information about releases on the repository. */ releases_url: string; /** The API URL to list the stargazers on the repository. */ stargazers_url: string; /** A template for the API URL to get information about statuses of a commit. */ statuses_url: string; /** The API URL to list the subscribers on the repository. */ subscribers_url: string; /** The API URL to subscribe to notifications for this repository. */ subscription_url: string; /** The API URL to get information about tags on the repository. */ tags_url: string; /** The API URL to list the teams on the repository. */ teams_url: string; /** A template for the API URL to create or retrieve a raw Git tree of the repository. */ trees_url: string; /** The API URL to list the hooks on the repository. */ hooks_url: string; } export type CodeScanningVariantAnalysisStatus = | "in_progress" | "succeeded" | "failed" | "cancelled"; /** The reason for a failure of the variant analysis. This is only available if the variant analysis has failed. */ export type CodeScanningVariantAnalysisFailureReason = | "no_repos_queried" | "actions_workflow_run_failed" | "internal_error"; /** Repository Identifier */ export interface CodeScanningVariantAnalysisRepository { /** A unique identifier of the repository. */ id: number; /** The name of the repository. */ name: string; /** The full, globally unique, name of the repository. */ full_name: string; /** Whether the repository is private. */ private: boolean; stargazers_count: number; updated_at: string | null; } /** The new status of the CodeQL variant analysis repository task. */ export type CodeScanningVariantAnalysisStatus2 = | "pending" | "in_progress" | "succeeded" | "failed" | "canceled" | "timed_out"; export interface CodeScanningVariantAnalysisScannedRepositoriesItem { repository: CodeScanningVariantAnalysisRepository; analysis_status: CodeScanningVariantAnalysisStatus2; /** The number of results in the case of a successful analysis. This is only available for successful analyses. */ result_count?: number | undefined; /** The size of the artifact. This is only available for successful analyses. */ artifact_size_in_bytes?: number | undefined; /** The reason of the failure of this repo task. This is only available if the repository task has failed. */ failure_message?: string | undefined; } export type CodeScanningVariantAnalysisScannedRepositoriesList = Array; /** A list of repositories that were skipped. This list may not include all repositories that were skipped. This is only available when the repository was found and the user has access to it. */ export type CodeScanningVariantAnalysisSkippedRepoGroupRepositoriesList = Array; export interface CodeScanningVariantAnalysisSkippedRepoGroup { /** The total number of repositories that were skipped for this reason. */ repository_count: number; /** A list of repositories that were skipped. This list may not include all repositories that were skipped. This is only available when the repository was found and the user has access to it. */ repositories: CodeScanningVariantAnalysisSkippedRepoGroupRepositoriesList; } /** A list of full repository names that were skipped. This list may not include all repositories that were skipped. */ export type CodeScanningVariantAnalysisSkippedRepositoriesNotFoundReposRepositoryFullNamesList = Array; export interface CodeScanningVariantAnalysisSkippedRepositoriesNotFoundRepos { /** The total number of repositories that were skipped for this reason. */ repository_count: number; /** A list of full repository names that were skipped. This list may not include all repositories that were skipped. */ repository_full_names: CodeScanningVariantAnalysisSkippedRepositoriesNotFoundReposRepositoryFullNamesList; } /** Information about repositories that were skipped from processing. This information is only available to the user that initiated the variant analysis. */ export interface CodeScanningVariantAnalysisSkippedRepositories { access_mismatch_repos: CodeScanningVariantAnalysisSkippedRepoGroup; not_found_repos: CodeScanningVariantAnalysisSkippedRepositoriesNotFoundRepos; no_codeql_db_repos: CodeScanningVariantAnalysisSkippedRepoGroup; over_limit_repos: CodeScanningVariantAnalysisSkippedRepoGroup; } /** A run of a CodeQL query against one or more repositories. */ export interface CodeScanningVariantAnalysis { /** The ID of the variant analysis. */ id: number; controller_repo: SimpleRepository; actor: SimpleUser; query_language: CodeScanningVariantAnalysisLanguage; /** The download url for the query pack. */ query_pack_url: string; /** The date and time at which the variant analysis was created, in ISO 8601 format':' YYYY-MM-DDTHH:MM:SSZ. */ created_at?: string | undefined; /** The date and time at which the variant analysis was last updated, in ISO 8601 format':' YYYY-MM-DDTHH:MM:SSZ. */ updated_at?: string | undefined; /** The date and time at which the variant analysis was completed, in ISO 8601 format':' YYYY-MM-DDTHH:MM:SSZ. Will be null if the variant analysis has not yet completed or this information is not available. */ completed_at?: string | null | undefined; status: CodeScanningVariantAnalysisStatus; /** The GitHub Actions workflow run used to execute this variant analysis. This is only available if the workflow run has started. */ actions_workflow_run_id?: number | undefined; /** The reason for a failure of the variant analysis. This is only available if the variant analysis has failed. */ failure_reason?: CodeScanningVariantAnalysisFailureReason | undefined; scanned_repositories?: CodeScanningVariantAnalysisScannedRepositoriesList | undefined; /** Information about repositories that were skipped from processing. This information is only available to the user that initiated the variant analysis. */ skipped_repositories?: CodeScanningVariantAnalysisSkippedRepositories | undefined; } export interface DeleteAnalysisRequest { /** The account owner of the repository. The name is not case sensitive. */ owner: string; /** The name of the repository without the `.git` extension. The name is not case sensitive. */ repo: string; /** The ID of the analysis, as returned from the `GET /repos/{owner}/{repo}/code-scanning/analyses` operation. */ analysis_id: number; /** Allow deletion if the specified analysis is the last in a set. If you attempt to delete the final analysis in a set without setting this parameter to `true`, you'll get a 400 response with the message: `Analysis is last of its type and deletion may result in the loss of historical alert data. Please specify confirm_delete.` */ confirm_delete?: string | undefined; } /** Successful deletion of a code scanning analysis */ export interface CodeScanningAnalysisDeletion { /** Next deletable analysis in chain, without last analysis deletion confirmation */ next_analysis_url: string | null; /** Next deletable analysis in chain, with last analysis deletion confirmation */ confirm_delete_url: string | null; } export interface DeleteCodeqlDatabaseRequest { /** The account owner of the repository. The name is not case sensitive. */ owner: string; /** The name of the repository without the `.git` extension. The name is not case sensitive. */ repo: string; /** The language of the CodeQL database. */ language: string; } export interface DeleteCodeqlDatabaseResponse {} export interface GetAiScanEnablementRequest { /** The account owner of the repository. The name is not case sensitive. */ owner: string; /** The name of the repository without the `.git` extension. The name is not case sensitive. */ repo: string; } /** Whether AI Scan is enabled for the repository. */ export type CodeScanningAiScanEnablementPrScan = "enabled" | "disabled"; /** AI Scan enablement for a repository. */ export interface CodeScanningAiScanEnablement { /** Whether AI Scan is enabled for the repository. */ pr_scan: CodeScanningAiScanEnablementPrScan; } export interface GetAiScanEnablementForOrgRequest { /** The organization name. The name is not case sensitive. */ org: string; } /** Whether AI Scan on pull requests is enabled for the organization. The organization setting respects enterprise policy, and repositories inherit it: when disabled, repositories cannot enable AI Scan; when enabled, repositories can still opt out. */ export type CodeScanningAiScanOrgSettingsPrScan = "enabled" | "disabled"; /** The AI Scan organization setting */ export interface CodeScanningAiScanOrgSettings { /** Whether AI Scan on pull requests is enabled for the organization. The organization setting respects enterprise policy, and repositories inherit it: when disabled, repositories cannot enable AI Scan; when enabled, repositories can still opt out. */ pr_scan: CodeScanningAiScanOrgSettingsPrScan; } export interface GetAlertRequest { /** The account owner of the repository. The name is not case sensitive. */ owner: string; /** The name of the repository without the `.git` extension. The name is not case sensitive. */ repo: string; /** The number that identifies an alert. You can find this at the end of the URL for a code scanning alert within GitHub, and in the `number` field in the response from the `GET /repos/{owner}/{repo}/code-scanning/alerts` operation. */ alert_number: number; } /** State of a code scanning alert. */ export type CodeScanningAlertState = "open" | "dismissed" | "fixed"; /** A GitHub user. */ export type NullableSimpleUser = SimpleUser; /** **Required when the state is dismissed.** The reason for dismissing or closing the alert. */ export type CodeScanningAlertDismissedReason = | "false positive" | "won't fix" | "used in tests" | "mitigated"; /** The severity of the alert. */ export type CodeScanningAlertRuleSeverity = "none" | "note" | "warning" | "error"; /** The security severity of the alert. */ export type CodeScanningAlertRuleSecuritySeverityLevel = "low" | "medium" | "high" | "critical"; /** A set of tags applicable for the rule. */ export type CodeScanningAlertRuleTagsList = Array; export interface CodeScanningAlertRule { /** A unique identifier for the rule used to detect the alert. */ id?: string | null | undefined; /** The name of the rule used to detect the alert. */ name?: string | undefined; /** The severity of the alert. */ severity?: CodeScanningAlertRuleSeverity | null | undefined; /** The security severity of the alert. */ security_severity_level?: CodeScanningAlertRuleSecuritySeverityLevel | null | undefined; /** A short description of the rule used to detect the alert. */ description?: string | undefined; /** A description of the rule used to detect the alert. */ full_description?: string | undefined; /** A set of tags applicable for the rule. */ tags?: CodeScanningAlertRuleTagsList | null | undefined; /** Detailed documentation for the rule as GitHub Flavored Markdown. */ help?: string | null | undefined; /** A link to the documentation for the rule used to detect the alert. */ help_uri?: string | null | undefined; } export interface CodeScanningAnalysisTool { name?: string | undefined; version?: string | null | undefined; guid?: string | null | undefined; } export interface CodeScanningAlertInstanceMessage { text?: string | undefined; /** The message text as GitHub-flavored Markdown, with placeholder links for related locations replaced by links to the relevant code. Only populated when related locations are available for the alert instance. */ markdown?: string | undefined; } /** Describe a region within a file for the alert. */ export interface CodeScanningAlertLocation { path?: string | undefined; start_line?: number | undefined; end_line?: number | undefined; start_column?: number | undefined; end_column?: number | undefined; } /** A classification of the file. For example to identify it as generated. */ export type CodeScanningAlertClassification = "source" | "generated" | "test" | "library"; /** Classifications that have been applied to the file that triggered the alert. For example identifying it as documentation, or a generated file. */ export type CodeScanningAlertInstanceClassificationsList = Array; export interface CodeScanningAlertInstance { ref?: string | undefined; analysis_key?: string | undefined; environment?: string | undefined; category?: string | undefined; state?: CodeScanningAlertState | null | undefined; commit_sha?: string | undefined; message?: CodeScanningAlertInstanceMessage | undefined; location?: CodeScanningAlertLocation | undefined; html_url?: string | undefined; /** Classifications that have been applied to the file that triggered the alert. For example identifying it as documentation, or a generated file. */ classifications?: CodeScanningAlertInstanceClassificationsList | undefined; } export type CodeScanningAlertAssigneesList = Array; export interface PullRequestSimpleLabelsItem { id: number; node_id: string; url: string; name: string; description: string; color: string; default: boolean; /** The user who archived the label, or `null` if it has not been archived. */ archived_by: SimpleUser | null; } export type PullRequestSimpleLabelsList = Array; /** The state of the milestone. */ export type NullableMilestoneState = "open" | "closed"; /** A collection of related issues and pull requests. */ export interface NullableMilestone { url: string; html_url: string; labels_url: string; id: number; node_id: string; /** The number of the milestone. */ number: number; /** The state of the milestone. */ state: NullableMilestoneState; /** The title of the milestone. */ title: string; description: string | null; creator: SimpleUser | null; open_issues: number; closed_issues: number; created_at: string; updated_at: string; closed_at: string | null; due_on: string | null; } export type PullRequestSimpleAssigneesList = Array; export type PullRequestSimpleRequestedReviewersList = Array; export interface TeamPermissions { pull: boolean; triage: boolean; push: boolean; maintain: boolean; admin: boolean; } /** The ownership type of the team */ export type TeamType = "enterprise" | "organization"; /** How the team's access to the repository was granted. This property is only present when the team is returned in a repository context, such as `GET /repos/{owner}/{repo}/teams`. */ export type TeamAccessSource = "direct" | "organization" | "enterprise"; /** The ownership type of the team */ export type NullableTeamSimpleType = "enterprise" | "organization"; /** Groups of organization members that gives permissions on specified repositories. */ export interface NullableTeamSimple { /** Unique identifier of the team */ id: number; node_id: string; /** URL for the team */ url: string; members_url: string; /** Name of the team */ name: string; /** Description of the team */ description: string | null; /** Permission that the team will have for its repositories */ permission: string; /** The level of privacy this team should have */ privacy?: string | undefined; /** The notification setting the team has set */ notification_setting?: string | undefined; html_url: string; repositories_url: string; slug: string; /** Distinguished Name (DN) that team maps to within LDAP environment */ ldap_dn?: string | undefined; /** The ownership type of the team */ type: NullableTeamSimpleType; /** Unique identifier of the organization to which this team belongs */ organization_id?: number | undefined; /** Unique identifier of the enterprise to which this team belongs */ enterprise_id?: number | undefined; } /** Groups of organization members that gives permissions on specified repositories. */ export interface Team { id: number; node_id: string; name: string; slug: string; description: string | null; privacy?: string | undefined; notification_setting?: string | undefined; permission: string; permissions?: TeamPermissions | undefined; url: string; html_url: string; members_url: string; repositories_url: string; /** The ownership type of the team */ type: TeamType; /** How the team's access to the repository was granted. This property is only present when the team is returned in a repository context, such as `GET /repos/{owner}/{repo}/teams`. */ access_source?: TeamAccessSource | undefined; /** Unique identifier of the organization to which this team belongs */ organization_id?: number | undefined; /** Unique identifier of the enterprise to which this team belongs */ enterprise_id?: number | undefined; parent: NullableTeamSimple | null; } export type PullRequestSimpleRequestedTeamsList = Array; /** License Simple */ export interface NullableLicenseSimple { key: string; name: string; url: string | null; spdx_id: string | null; node_id: string; html_url?: string | undefined; } export interface RepositoryPermissions { admin: boolean; pull: boolean; triage?: boolean | undefined; push: boolean; maintain?: boolean | undefined; } export type RepositoryTopicsList = Array; /** The policy controlling who can create pull requests: all or collaborators_only. */ export type RepositoryPullRequestCreationPolicy = "all" | "collaborators_only"; /** The default value for a squash merge commit title: - `PR_TITLE` - default to the pull request's title. - `COMMIT_OR_PR_TITLE` - default to the commit's title (if only one commit) or the pull request's title (when more than one commit). */ export type RepositorySquashMergeCommitTitle = "PR_TITLE" | "COMMIT_OR_PR_TITLE"; /** The default value for a squash merge commit message: - `PR_BODY` - default to the pull request's body. - `COMMIT_MESSAGES` - default to the branch's commit messages. - `BLANK` - default to a blank commit message. */ export type RepositorySquashMergeCommitMessage = "PR_BODY" | "COMMIT_MESSAGES" | "BLANK"; /** The default value for a merge commit title. - `PR_TITLE` - default to the pull request's title. - `MERGE_MESSAGE` - default to the classic title for a merge message (e.g., Merge pull request #123 from branch-name). */ export type RepositoryMergeCommitTitle = "PR_TITLE" | "MERGE_MESSAGE"; /** The default value for a merge commit message. - `PR_TITLE` - default to the pull request's title. - `PR_BODY` - default to the pull request's body. - `BLANK` - default to a blank commit message. */ export type RepositoryMergeCommitMessage = "PR_BODY" | "PR_TITLE" | "BLANK"; /** The status of the code search index for this repository */ export interface RepositoryCodeSearchIndexStatus { lexical_search_ok?: boolean | undefined; lexical_commit_sha?: string | undefined; } /** A repository on GitHub. */ export interface Repository { /** Unique identifier of the repository */ id: number; node_id: string; /** The name of the repository. */ name: string; full_name: string; license: NullableLicenseSimple | null; forks: number; permissions?: RepositoryPermissions | undefined; owner: SimpleUser; /** Whether the repository is private or public. */ private: boolean; html_url: string; description: string | null; fork: boolean; url: string; archive_url: string; assignees_url: string; blobs_url: string; branches_url: string; collaborators_url: string; comments_url: string; commits_url: string; compare_url: string; contents_url: string; contributors_url: string; deployments_url: string; downloads_url: string; events_url: string; forks_url: string; git_commits_url: string; git_refs_url: string; git_tags_url: string; git_url: string; issue_comment_url: string; issue_events_url: string; issues_url: string; keys_url: string; labels_url: string; languages_url: string; merges_url: string; milestones_url: string; notifications_url: string; pulls_url: string; releases_url: string; ssh_url: string; stargazers_url: string; statuses_url: string; subscribers_url: string; subscription_url: string; tags_url: string; teams_url: string; trees_url: string; clone_url: string; mirror_url: string | null; hooks_url: string; svn_url: string; homepage: string | null; language: string | null; forks_count: number; stargazers_count: number; watchers_count: number; /** The size of the repository, in kilobytes. Size is calculated hourly. When a repository is initially created, the size is 0. */ size: number; /** The default branch of the repository. */ default_branch: string; open_issues_count: number; /** Whether this repository acts as a template that can be used to generate new repositories. */ is_template?: boolean | undefined; topics?: RepositoryTopicsList | undefined; /** Whether issues are enabled. */ has_issues: boolean; /** Whether projects are enabled. */ has_projects: boolean; /** Whether the wiki is enabled. */ has_wiki: boolean; has_pages: boolean; /** Whether downloads are enabled. */ has_downloads: boolean; /** Whether discussions are enabled. */ has_discussions?: boolean | undefined; /** Whether pull requests are enabled. */ has_pull_requests?: boolean | undefined; /** The policy controlling who can create pull requests: all or collaborators_only. */ pull_request_creation_policy?: RepositoryPullRequestCreationPolicy | undefined; /** Whether the repository is archived. */ archived: boolean; /** Returns whether or not this repository disabled. */ disabled: boolean; /** The repository visibility: public, private, or internal. */ visibility?: string | undefined; pushed_at: string | null; created_at: string | null; updated_at: string | null; /** Whether to allow rebase merges for pull requests. */ allow_rebase_merge?: boolean | undefined; /** When present and non-empty, a temporary credential for read-only Git access to this repository. It expires five minutes after generation and cannot be used to push changes. Treat this value as sensitive and avoid recording it in logs. */ temp_clone_token?: string | Redacted.Redacted | undefined; /** Whether to allow squash merges for pull requests. */ allow_squash_merge?: boolean | undefined; /** Whether to allow Auto-merge to be used on pull requests. */ allow_auto_merge?: boolean | undefined; /** Whether to delete head branches when pull requests are merged */ delete_branch_on_merge?: boolean | undefined; /** Whether or not a pull request head branch that is behind its base branch can always be updated even if it is not required to be up to date before merging. */ allow_update_branch?: boolean | undefined; /** Whether a squash merge commit can use the pull request title as default. **This property is closing down. Please use `squash_merge_commit_title` instead. */ use_squash_pr_title_as_default?: boolean | undefined; /** The default value for a squash merge commit title: - `PR_TITLE` - default to the pull request's title. - `COMMIT_OR_PR_TITLE` - default to the commit's title (if only one commit) or the pull request's title (when more than one commit). */ squash_merge_commit_title?: RepositorySquashMergeCommitTitle | undefined; /** The default value for a squash merge commit message: - `PR_BODY` - default to the pull request's body. - `COMMIT_MESSAGES` - default to the branch's commit messages. - `BLANK` - default to a blank commit message. */ squash_merge_commit_message?: RepositorySquashMergeCommitMessage | undefined; /** The default value for a merge commit title. - `PR_TITLE` - default to the pull request's title. - `MERGE_MESSAGE` - default to the classic title for a merge message (e.g., Merge pull request #123 from branch-name). */ merge_commit_title?: RepositoryMergeCommitTitle | undefined; /** The default value for a merge commit message. - `PR_TITLE` - default to the pull request's title. - `PR_BODY` - default to the pull request's body. - `BLANK` - default to a blank commit message. */ merge_commit_message?: RepositoryMergeCommitMessage | undefined; /** Whether to allow merge commits for pull requests. */ allow_merge_commit?: boolean | undefined; /** Whether to allow forking this repo */ allow_forking?: boolean | undefined; /** Whether to require contributors to sign off on web-based commits */ web_commit_signoff_required?: boolean | undefined; open_issues: number; watchers: number; master_branch?: string | undefined; starred_at?: string | undefined; /** Whether anonymous git access is enabled for this repository */ anonymous_access_enabled?: boolean | undefined; /** The status of the code search index for this repository */ code_search_index_status?: RepositoryCodeSearchIndexStatus | undefined; } export interface PullRequestSimpleHead { label: string; ref: string; repo: Repository; sha: string; user: SimpleUser | null; } export type PullRequestSimpleBase = PullRequestSimpleHead; /** Hypermedia Link */ export interface Link { href: string; } export interface PullRequestSimpleLinks { comments: Link; commits: Link; statuses: Link; html: Link; issue: Link; review_comments: Link; review_comment: Link; self: Link; } /** How the author is associated with the repository. */ export type AuthorAssociation = | "COLLABORATOR" | "CONTRIBUTOR" | "FIRST_TIMER" | "FIRST_TIME_CONTRIBUTOR" | "MANNEQUIN" | "MEMBER" | "NONE" | "OWNER"; /** The merge method to use. */ export type AutoMergeMergeMethod = "merge" | "squash" | "rebase"; /** The status of auto merging a pull request. */ export interface AutoMerge { enabled_by: SimpleUser; /** The merge method to use. */ merge_method: AutoMergeMergeMethod; /** Title for the merge commit message. */ commit_title: string; /** Commit message for the merge commit. */ commit_message: string; } export interface PullRequestStackBase { /** The base ref of the stack this pull request belongs to. */ ref: string; /** The base SHA of the stack this pull request belongs to. */ sha: string; } /** The stack information associated with a pull request. */ export interface PullRequestStack { base: PullRequestStackBase; /** The total number of pull requests in the stack. */ size?: number | undefined; /** The one-based position of this pull request within the stack, where 1 is the bottom of the stack. */ position?: number | undefined; /** The ID of the stack that this pull request belongs to. */ id?: number | undefined; /** The number of the stack that this pull request belongs to. */ number?: number | undefined; } /** Pull Request Simple */ export interface PullRequestSimple { url: string; id: number; node_id: string; html_url: string; diff_url: string; patch_url: string; issue_url: string; commits_url: string; review_comments_url: string; review_comment_url: string; comments_url: string; statuses_url: string; number: number; state: string; locked: boolean; title: string; user: SimpleUser | null; body: string | null; labels: PullRequestSimpleLabelsList; milestone: NullableMilestone | null; active_lock_reason?: string | null | undefined; created_at: string; updated_at: string; closed_at: string | null; merged_at: string | null; merge_commit_sha: string | null; assignee: SimpleUser | null; assignees?: PullRequestSimpleAssigneesList | undefined; requested_reviewers?: PullRequestSimpleRequestedReviewersList | undefined; requested_teams?: PullRequestSimpleRequestedTeamsList | undefined; head: PullRequestSimpleHead; base: PullRequestSimpleHead; _links: PullRequestSimpleLinks; author_association: AuthorAssociation; auto_merge: AutoMerge | null; stack?: PullRequestStack | null | undefined; /** Indicates whether or not the pull request is a draft. */ draft?: boolean | undefined; } /** Pull requests linked to this alert. */ export type CodeScanningAlertLinkedPullRequestsList = Array; export interface CodeScanningAlert { number: number; created_at: string; updated_at?: string | undefined; url: string; html_url: string; instances_url: string; state: CodeScanningAlertState | null; fixed_at?: string | null | undefined; dismissed_by: SimpleUser | null; dismissed_at: string | null; dismissed_reason: CodeScanningAlertDismissedReason | null; dismissed_comment?: string | null | undefined; rule: CodeScanningAlertRule; tool: CodeScanningAnalysisTool; most_recent_instance: CodeScanningAlertInstance; dismissal_approved_by?: SimpleUser | null | undefined; assignees?: CodeScanningAlertAssigneesList | undefined; /** Pull requests linked to this alert. */ linked_pull_requests?: CodeScanningAlertLinkedPullRequestsList | undefined; } export interface GetAnalysisRequest { /** The account owner of the repository. The name is not case sensitive. */ owner: string; /** The name of the repository without the `.git` extension. The name is not case sensitive. */ repo: string; /** The ID of the analysis, as returned from the `GET /repos/{owner}/{repo}/code-scanning/analyses` operation. */ analysis_id: number; } export interface CodeScanningAnalysis { ref: string; commit_sha: string; analysis_key: string; environment: string; category?: string | undefined; error: string; created_at: string; /** The total number of results in the analysis. */ results_count: number; /** The total number of rules used in the analysis. */ rules_count: number; /** Unique identifier for this analysis. */ id: number; url: string; sarif_id: string; tool: CodeScanningAnalysisTool; deletable: boolean; /** Warning generated when processing the analysis */ warning: string; } export interface GetAutofixRequest { /** The account owner of the repository. The name is not case sensitive. */ owner: string; /** The name of the repository without the `.git` extension. The name is not case sensitive. */ repo: string; /** The number that identifies an alert. You can find this at the end of the URL for a code scanning alert within GitHub, and in the `number` field in the response from the `GET /repos/{owner}/{repo}/code-scanning/alerts` operation. */ alert_number: number; } export interface GetCodeqlDatabaseRequest { /** The account owner of the repository. The name is not case sensitive. */ owner: string; /** The name of the repository without the `.git` extension. The name is not case sensitive. */ repo: string; /** The language of the CodeQL database. */ language: string; } /** A CodeQL database. */ export interface CodeScanningCodeqlDatabase { /** The ID of the CodeQL database. */ id: number; /** The name of the CodeQL database. */ name: string; /** The language of the CodeQL database. */ language: string; uploader: SimpleUser; /** The MIME type of the CodeQL database file. */ content_type: string; /** The size of the CodeQL database file in bytes. */ size: number; /** The date and time at which the CodeQL database was created, in ISO 8601 format':' YYYY-MM-DDTHH:MM:SSZ. */ created_at: string; /** The date and time at which the CodeQL database was last updated, in ISO 8601 format':' YYYY-MM-DDTHH:MM:SSZ. */ updated_at: string; /** The URL at which to download the CodeQL database. The `Accept` header must be set to the value of the `content_type` property. */ url: string; /** The commit SHA of the repository at the time the CodeQL database was created. */ commit_oid?: string | null | undefined; } export interface GetDefaultSetupRequest { /** The account owner of the repository. The name is not case sensitive. */ owner: string; /** The name of the repository without the `.git` extension. The name is not case sensitive. */ repo: string; } /** Code scanning default setup has been configured or not. */ export type CodeScanningDefaultSetupState = "configured" | "not-configured"; export type CodeScanningDefaultSetupLanguagesItem = | "actions" | "c-cpp" | "csharp" | "go" | "java-kotlin" | "javascript-typescript" | "javascript" | "python" | "ruby" | "typescript" | "swift"; /** Languages to be analyzed. */ export type CodeScanningDefaultSetupLanguagesList = Array; /** Runner type to be used. */ export type CodeScanningDefaultSetupRunnerType = "standard" | "labeled"; /** CodeQL query suite to be used. */ export type CodeScanningDefaultSetupQuerySuite = "default" | "extended"; /** Threat model to be used for code scanning analysis. Use `remote` to analyze only network sources and `remote_and_local` to include local sources like filesystem access, command-line arguments, database reads, environment variable and standard input. */ export type CodeScanningDefaultSetupThreatModel = "remote" | "remote_and_local"; /** The frequency of the periodic analysis. */ export type CodeScanningDefaultSetupSchedule = "weekly"; /** Configuration for code scanning default setup. */ export interface CodeScanningDefaultSetup { /** Code scanning default setup has been configured or not. */ state?: CodeScanningDefaultSetupState | undefined; /** Languages to be analyzed. */ languages?: CodeScanningDefaultSetupLanguagesList | undefined; /** Runner type to be used. */ runner_type?: CodeScanningDefaultSetupRunnerType | null | undefined; /** Runner label to be used if the runner type is labeled. */ runner_label?: string | null | undefined; /** CodeQL query suite to be used. */ query_suite?: CodeScanningDefaultSetupQuerySuite | undefined; /** Threat model to be used for code scanning analysis. Use `remote` to analyze only network sources and `remote_and_local` to include local sources like filesystem access, command-line arguments, database reads, environment variable and standard input. */ threat_model?: CodeScanningDefaultSetupThreatModel | undefined; /** Timestamp of latest configuration update. */ updated_at?: string | null | undefined; /** The frequency of the periodic analysis. */ schedule?: CodeScanningDefaultSetupSchedule | null | undefined; } export interface GetSarifRequest { /** The account owner of the repository. The name is not case sensitive. */ owner: string; /** The name of the repository without the `.git` extension. The name is not case sensitive. */ repo: string; /** The SARIF ID obtained after uploading. */ sarif_id: string; } /** `pending` files have not yet been processed, while `complete` means results from the SARIF have been stored. `failed` files have either not been processed at all, or could only be partially processed. */ export type CodeScanningSarifsStatusProcessingStatus = "pending" | "complete" | "failed"; /** Any errors that ocurred during processing of the delivery. */ export type CodeScanningSarifsStatusErrorsList = Array; export interface CodeScanningSarifsStatus { /** `pending` files have not yet been processed, while `complete` means results from the SARIF have been stored. `failed` files have either not been processed at all, or could only be partially processed. */ processing_status?: CodeScanningSarifsStatusProcessingStatus | undefined; /** The REST API URL for getting the analyses associated with the upload. */ analyses_url?: string | null | undefined; /** Any errors that ocurred during processing of the delivery. */ errors?: CodeScanningSarifsStatusErrorsList | null | undefined; } export interface GetVariantAnalysisRequest { /** The account owner of the repository. The name is not case sensitive. */ owner: string; /** The name of the repository without the `.git` extension. The name is not case sensitive. */ repo: string; /** The unique identifier of the variant analysis. */ codeql_variant_analysis_id: number; } export interface GetVariantAnalysisRepoTaskRequest { /** The account owner of the repository. The name is not case sensitive. */ owner: string; /** The name of the controller repository. */ repo: string; /** The ID of the variant analysis. */ codeql_variant_analysis_id: number; /** The account owner of the variant analysis repository. The name is not case sensitive. */ repo_owner: string; /** The name of the variant analysis repository. */ repo_name: string; } export interface CodeScanningVariantAnalysisRepoTask { repository: SimpleRepository; analysis_status: CodeScanningVariantAnalysisStatus2; /** The size of the artifact. This is only available for successful analyses. */ artifact_size_in_bytes?: number | undefined; /** The number of results in the case of a successful analysis. This is only available for successful analyses. */ result_count?: number | undefined; /** The reason of the failure of this repo task. This is only available if the repository task has failed. */ failure_message?: string | undefined; /** The SHA of the commit the CodeQL database was built against. This is only available for successful analyses. */ database_commit_sha?: string | undefined; /** The source location prefix to use. This is only available for successful analyses. */ source_location_prefix?: string | undefined; /** The URL of the artifact. This is only available for successful analyses. */ artifact_url?: string | undefined; } export interface ListAlertInstancesRequest { /** The account owner of the repository. The name is not case sensitive. */ owner: string; /** The name of the repository without the `.git` extension. The name is not case sensitive. */ repo: string; /** The number that identifies an alert. You can find this at the end of the URL for a code scanning alert within GitHub, and in the `number` field in the response from the `GET /repos/{owner}/{repo}/code-scanning/alerts` operation. */ alert_number: number; /** The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." */ page?: number | undefined; /** The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." */ per_page?: number | undefined; /** The Git reference for the results you want to list. The `ref` for a branch can be formatted either as `refs/heads/` or simply ``. To reference a pull request use `refs/pull//merge`. */ ref?: string | undefined; /** The number of the pull request for the results you want to list. */ pr?: number | undefined; } /** State of a code scanning alert instance. */ export type CodeScanningAlertInstanceState = "open" | "fixed"; export interface CodeScanningAlertInstanceListMessage { text?: string | undefined; } /** Classifications that have been applied to the file that triggered the alert. For example identifying it as documentation, or a generated file. */ export type CodeScanningAlertInstanceListClassificationsList = Array; export interface CodeScanningAlertInstanceList { ref?: string | undefined; analysis_key?: string | undefined; environment?: string | undefined; category?: string | undefined; state?: CodeScanningAlertInstanceState | null | undefined; commit_sha?: string | undefined; message?: CodeScanningAlertInstanceListMessage | undefined; location?: CodeScanningAlertLocation | undefined; html_url?: string | undefined; /** Classifications that have been applied to the file that triggered the alert. For example identifying it as documentation, or a generated file. */ classifications?: CodeScanningAlertInstanceListClassificationsList | undefined; } export type ListAlertInstancesResponseBodyList = Array; export type ListAlertInstancesResponse = ListAlertInstancesResponseBodyList; export type ListAlertsForOrgRequestDirection = "asc" | "desc"; /** State of a code scanning alert. */ export type CodeScanningAlertStateQuery = "open" | "closed" | "dismissed" | "fixed"; export type ListAlertsForOrgRequestSort = "created" | "updated"; /** Severity of a code scanning alert. */ export type CodeScanningAlertSeverity = | "critical" | "high" | "medium" | "low" | "warning" | "note" | "error"; export interface ListAlertsForOrgRequest { /** The organization name. The name is not case sensitive. */ org: string; /** The name of a code scanning tool. Only results by this tool will be listed. You can specify the tool by using either `tool_name` or `tool_guid`, but not both. */ tool_name?: string | undefined; /** The GUID of a code scanning tool. Only results by this tool will be listed. Note that some code scanning tools may not include a GUID in their analysis data. You can specify the tool by using either `tool_guid` or `tool_name`, but not both. */ tool_guid?: string | undefined; /** A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results before this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." */ before?: string | undefined; /** A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results after this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." */ after?: string | undefined; /** The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." */ page?: number | undefined; /** The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." */ per_page?: number | undefined; /** The direction to sort the results by. */ direction?: ListAlertsForOrgRequestDirection | (string & {}) | undefined; /** If specified, only code scanning alerts with this state will be returned. */ state?: CodeScanningAlertStateQuery | (string & {}) | undefined; /** The property by which to sort the results. */ sort?: ListAlertsForOrgRequestSort | (string & {}) | undefined; /** If specified, only code scanning alerts with this severity will be returned. */ severity?: CodeScanningAlertSeverity | (string & {}) | undefined; /** Filter alerts by assignees. Provide a comma-separated list of user handles (e.g., `octocat` or `octocat,hubot`). Use `*` to list alerts with at least one assignee or `none` to list alerts with no assignees. */ assignees?: string | undefined; } /** The severity of the alert. */ export type CodeScanningAlertRuleSummarySeverity = "none" | "note" | "warning" | "error"; /** The security severity of the alert. */ export type CodeScanningAlertRuleSummarySecuritySeverityLevel = | "low" | "medium" | "high" | "critical"; /** A set of tags applicable for the rule. */ export type CodeScanningAlertRuleSummaryTagsList = Array; export interface CodeScanningAlertRuleSummary { /** A unique identifier for the rule used to detect the alert. */ id?: string | null | undefined; /** The name of the rule used to detect the alert. */ name?: string | undefined; /** The severity of the alert. */ severity?: CodeScanningAlertRuleSummarySeverity | null | undefined; /** The security severity of the alert. */ security_severity_level?: CodeScanningAlertRuleSummarySecuritySeverityLevel | null | undefined; /** A short description of the rule used to detect the alert. */ description?: string | undefined; /** A description of the rule used to detect the alert. */ full_description?: string | undefined; /** A set of tags applicable for the rule. */ tags?: CodeScanningAlertRuleSummaryTagsList | null | undefined; /** Detailed documentation for the rule as GitHub Flavored Markdown. */ help?: string | null | undefined; /** A link to the documentation for the rule used to detect the alert. */ help_uri?: string | null | undefined; } export type CodeScanningOrganizationAlertItemsAssigneesList = Array; export interface CodeScanningOrganizationAlertItems { number: number; created_at: string; updated_at?: string | undefined; url: string; html_url: string; instances_url: string; state: CodeScanningAlertState | null; fixed_at?: string | null | undefined; dismissed_by: SimpleUser | null; dismissed_at: string | null; dismissed_reason: CodeScanningAlertDismissedReason | null; dismissed_comment?: string | null | undefined; rule: CodeScanningAlertRuleSummary; tool: CodeScanningAnalysisTool; most_recent_instance: CodeScanningAlertInstance; repository: SimpleRepository; dismissal_approved_by?: SimpleUser | null | undefined; assignees?: CodeScanningOrganizationAlertItemsAssigneesList | undefined; } export type ListAlertsForOrgResponseBodyList = Array; export type ListAlertsForOrgResponse = ListAlertsForOrgResponseBodyList; export type ListAlertsForRepoRequestDirection = "asc" | "desc"; export type ListAlertsForRepoRequestSort = "created" | "updated"; export interface ListAlertsForRepoRequest { /** The account owner of the repository. The name is not case sensitive. */ owner: string; /** The name of the repository without the `.git` extension. The name is not case sensitive. */ repo: string; /** The name of a code scanning tool. Only results by this tool will be listed. You can specify the tool by using either `tool_name` or `tool_guid`, but not both. */ tool_name?: string | undefined; /** The GUID of a code scanning tool. Only results by this tool will be listed. Note that some code scanning tools may not include a GUID in their analysis data. You can specify the tool by using either `tool_guid` or `tool_name`, but not both. */ tool_guid?: string | undefined; /** The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." */ page?: number | undefined; /** The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." */ per_page?: number | undefined; /** The Git reference for the results you want to list. The `ref` for a branch can be formatted either as `refs/heads/` or simply ``. To reference a pull request use `refs/pull//merge`. */ ref?: string | undefined; /** The number of the pull request for the results you want to list. */ pr?: number | undefined; /** The direction to sort the results by. */ direction?: ListAlertsForRepoRequestDirection | (string & {}) | undefined; /** A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results before this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." */ before?: string | undefined; /** A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results after this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." */ after?: string | undefined; /** The property by which to sort the results. */ sort?: ListAlertsForRepoRequestSort | (string & {}) | undefined; /** If specified, only code scanning alerts with this state will be returned. */ state?: CodeScanningAlertStateQuery | (string & {}) | undefined; /** If specified, only code scanning alerts with this severity will be returned. */ severity?: CodeScanningAlertSeverity | (string & {}) | undefined; /** Filter alerts by assignees. Provide a comma-separated list of user handles (e.g., `octocat` or `octocat,hubot`). Use `*` to list alerts with at least one assignee or `none` to list alerts with no assignees. */ assignees?: string | undefined; } export type CodeScanningAlertItemsAssigneesList = Array; export interface CodeScanningAlertItems { number: number; created_at: string; updated_at?: string | undefined; url: string; html_url: string; instances_url: string; state: CodeScanningAlertState | null; fixed_at?: string | null | undefined; dismissed_by: SimpleUser | null; dismissed_at: string | null; dismissed_reason: CodeScanningAlertDismissedReason | null; dismissed_comment?: string | null | undefined; rule: CodeScanningAlertRuleSummary; tool: CodeScanningAnalysisTool; most_recent_instance: CodeScanningAlertInstance; dismissal_approved_by?: SimpleUser | null | undefined; assignees?: CodeScanningAlertItemsAssigneesList | undefined; } export type ListAlertsForRepoResponseBodyList = Array; export type ListAlertsForRepoResponse = ListAlertsForRepoResponseBodyList; export interface ListCodeqlDatabasesRequest { /** The account owner of the repository. The name is not case sensitive. */ owner: string; /** The name of the repository without the `.git` extension. The name is not case sensitive. */ repo: string; } export type ListCodeqlDatabasesResponseBodyList = Array; export type ListCodeqlDatabasesResponse = ListCodeqlDatabasesResponseBodyList; export type ListRecentAnalysesRequestDirection = "asc" | "desc"; export type ListRecentAnalysesRequestSort = "created"; export interface ListRecentAnalysesRequest { /** The account owner of the repository. The name is not case sensitive. */ owner: string; /** The name of the repository without the `.git` extension. The name is not case sensitive. */ repo: string; /** The name of a code scanning tool. Only results by this tool will be listed. You can specify the tool by using either `tool_name` or `tool_guid`, but not both. */ tool_name?: string | undefined; /** The GUID of a code scanning tool. Only results by this tool will be listed. Note that some code scanning tools may not include a GUID in their analysis data. You can specify the tool by using either `tool_guid` or `tool_name`, but not both. */ tool_guid?: string | undefined; /** The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." */ page?: number | undefined; /** The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)." */ per_page?: number | undefined; /** The number of the pull request for the results you want to list. */ pr?: number | undefined; /** The Git reference for the analyses you want to list. The `ref` for a branch can be formatted either as `refs/heads/` or simply ``. To reference a pull request use `refs/pull//merge`. */ ref?: string | undefined; /** Filter analyses belonging to the same SARIF upload. */ sarif_id?: string | undefined; /** The direction to sort the results by. */ direction?: ListRecentAnalysesRequestDirection | (string & {}) | undefined; /** The property by which to sort the results. */ sort?: ListRecentAnalysesRequestSort | (string & {}) | undefined; } export type ListRecentAnalysesResponseBodyList = Array; export type ListRecentAnalysesResponse = ListRecentAnalysesResponseBodyList; /** Whether to enable or disable AI Scan for the repository. */ export type UpdateAiScanEnablementRequestPrScan = "enabled" | "disabled"; export interface UpdateAiScanEnablementRequest { /** The account owner of the repository. The name is not case sensitive. */ owner: string; /** The name of the repository without the `.git` extension. The name is not case sensitive. */ repo: string; /** Whether to enable or disable AI Scan for the repository. */ pr_scan?: UpdateAiScanEnablementRequestPrScan | (string & {}) | undefined; } /** Whether AI Scan is enabled for the organization. Organization respects enterprise policy. Disabled organizations prevent repositories from enabling AI Scan. Enabled organizations enable AI Scan for their repositories, but individual repositories can opt out. */ export type UpdateAiScanEnablementForOrgRequestPrScan = "enabled" | "disabled"; export interface UpdateAiScanEnablementForOrgRequest { /** The organization name. The name is not case sensitive. */ org: string; /** Whether AI Scan is enabled for the organization. Organization respects enterprise policy. Disabled organizations prevent repositories from enabling AI Scan. Enabled organizations enable AI Scan for their repositories, but individual repositories can opt out. */ pr_scan?: UpdateAiScanEnablementForOrgRequestPrScan | (string & {}) | undefined; } /** Sets the state of the code scanning alert. You must provide `dismissed_reason` when you set the state to `dismissed`. */ export type CodeScanningAlertSetState = "open" | "dismissed"; /** The list of users to assign to the code scanning alert. An empty array unassigns all previous assignees from the alert. */ export type CodeScanningAlertAssignees = Array; export interface UpdateAlertRequest { /** The account owner of the repository. The name is not case sensitive. */ owner: string; /** The name of the repository without the `.git` extension. The name is not case sensitive. */ repo: string; /** The number that identifies an alert. You can find this at the end of the URL for a code scanning alert within GitHub, and in the `number` field in the response from the `GET /repos/{owner}/{repo}/code-scanning/alerts` operation. */ alert_number: number; state?: CodeScanningAlertSetState | (string & {}) | undefined; dismissed_reason?: CodeScanningAlertDismissedReason | (string & {}) | null | undefined; dismissed_comment?: string | null | undefined; create_request?: boolean | undefined; assignees?: CodeScanningAlertAssignees | undefined; } /** The desired state of code scanning default setup. */ export type UpdateDefaultSetupRequestState = "configured" | "not-configured"; /** Runner type to be used. */ export type UpdateDefaultSetupRequestRunnerType = "standard" | "labeled"; /** CodeQL query suite to be used. */ export type UpdateDefaultSetupRequestQuerySuite = "default" | "extended"; /** Threat model to be used for code scanning analysis. Use `remote` to analyze only network sources and `remote_and_local` to include local sources like filesystem access, command-line arguments, database reads, environment variable and standard input. */ export type UpdateDefaultSetupRequestThreatModel = "remote" | "remote_and_local"; export type UpdateDefaultSetupRequestLanguagesItem = | "actions" | "c-cpp" | "csharp" | "go" | "java-kotlin" | "javascript-typescript" | "python" | "ruby" | "swift"; /** CodeQL languages to be analyzed. */ export type UpdateDefaultSetupRequestLanguagesList = Array< UpdateDefaultSetupRequestLanguagesItem | (string & {}) >; export interface UpdateDefaultSetupRequest { /** The account owner of the repository. The name is not case sensitive. */ owner: string; /** The name of the repository without the `.git` extension. The name is not case sensitive. */ repo: string; /** The desired state of code scanning default setup. */ state?: UpdateDefaultSetupRequestState | (string & {}) | undefined; /** Runner type to be used. */ runner_type?: UpdateDefaultSetupRequestRunnerType | (string & {}) | undefined; /** Runner label to be used if the runner type is labeled. */ runner_label?: string | null | undefined; /** CodeQL query suite to be used. */ query_suite?: UpdateDefaultSetupRequestQuerySuite | (string & {}) | undefined; /** Threat model to be used for code scanning analysis. Use `remote` to analyze only network sources and `remote_and_local` to include local sources like filesystem access, command-line arguments, database reads, environment variable and standard input. */ threat_model?: UpdateDefaultSetupRequestThreatModel | (string & {}) | undefined; /** CodeQL languages to be analyzed. */ languages?: UpdateDefaultSetupRequestLanguagesList | undefined; } export type UpdateDefaultSetupResponse = unknown; export interface UploadSarifRequest { /** The account owner of the repository. The name is not case sensitive. */ owner: string; /** The name of the repository without the `.git` extension. The name is not case sensitive. */ repo: string; commit_sha: string; ref: string; sarif: string; /** The base directory used in the analysis, as it appears in the SARIF file. This property is used to convert file paths from absolute to relative, so that alerts can be mapped to their correct location in the repository. */ checkout_uri?: string | undefined; /** The time that the analysis run began. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. */ started_at?: string | undefined; /** The name of the tool used to generate the code scanning analysis. If this parameter is not used, the tool name defaults to "API". If the uploaded SARIF contains a tool GUID, this will be available for filtering using the `tool_guid` parameter of operations such as `GET /repos/{owner}/{repo}/code-scanning/alerts`. */ tool_name?: string | undefined; /** Whether the SARIF file will be validated according to the code scanning specifications. This parameter is intended to help integrators ensure that the uploaded SARIF files are correctly rendered by code scanning. */ validate?: boolean | undefined; } export interface UploadSarifResponse {} export type CommitAutofixError = GithubOpError; /** Commit an autofix for a code scanning alert Commits an autofix for a code scanning alert from the repository's default branch. If an autofix is committed as a result of this request, then this endpoint will return a 201 Created response. OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories. */ export const commitAutofix: API.OperationMethod< CommitAutofixRequest, CodeScanningAutofixCommitsResponse, CommitAutofixError, GithubOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(0, __c0, 0) as any as S.Schema, output: __S(1, __c0, 1) as any as S.Schema, errors: [], serviceErrors: GithubServiceErrors, protocol: GithubProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "CommitAutofix", })); export type CreateAutofixError = GithubOpError; /** Create an autofix for a code scanning alert Creates an autofix for a code scanning alert from the repository's default branch. If a new autofix is to be created as a result of this request or is currently being generated, then this endpoint will return a 202 Accepted response. If an autofix already exists for a given alert, then this endpoint will return a 200 OK response. OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories. */ export const createAutofix: API.OperationMethod< CreateAutofixRequest, CodeScanningAutofix, CreateAutofixError, GithubOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(32, __c1, 0) as any as S.Schema, output: __S(64, __c2, 0) as any as S.Schema, errors: [], serviceErrors: GithubServiceErrors, protocol: GithubProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "CreateAutofix", })); export type CreateVariantAnalysisError = GithubOpError; /** Create a CodeQL variant analysis Creates a new CodeQL variant analysis, which will run a CodeQL query against one or more repositories. Get started by learning more about [running CodeQL queries at scale with Multi-Repository Variant Analysis](https://docs.github.com/code-security/codeql-for-vs-code/getting-started-with-codeql-for-vs-code/running-codeql-queries-at-scale-with-multi-repository-variant-analysis). Use the `owner` and `repo` parameters in the URL to specify the controller repository that will be used for running GitHub Actions workflows and storing the results of the CodeQL variant analysis. OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. */ export const createVariantAnalysis: API.OperationMethod< CreateVariantAnalysisRequest, CodeScanningVariantAnalysis, CreateVariantAnalysisError, GithubOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(480, __c15, 0) as any as S.Schema, output: __S(519, __c16, 7) as any as S.Schema, errors: [], serviceErrors: GithubServiceErrors, protocol: GithubProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "CreateVariantAnalysis", })); export type DeleteAnalysisError = GithubOpError; /** Delete a code scanning analysis from a repository Deletes a specified code scanning analysis from a repository. You can delete one analysis at a time. To delete a series of analyses, start with the most recent analysis and work backwards. Conceptually, the process is similar to the undo function in a text editor. When you list the analyses for a repository, one or more will be identified as deletable in the response: ``` "deletable": true ``` An analysis is deletable when it's the most recent in a set of analyses. Typically, a repository will have multiple sets of analyses for each enabled code scanning tool, where a set is determined by a unique combination of analysis values: * `ref` * `tool` * `category` If you attempt to delete an analysis that is not the most recent in a set, you'll get a 400 response with the message: ``` Analysis specified is not deletable. ``` The response from a successful `DELETE` operation provides you with two alternative URLs for deleting the next analysis in the set: `next_analysis_url` and `confirm_delete_url`. Use the `next_analysis_url` URL if you want to avoid accidentally deleting the final analysis in a set. This is a useful option if you want to preserve at least one analysis for the specified tool in your repository. Use the `confirm_delete_url` URL if you are content to remove all analyses for a tool. When you delete the last analysis in a set, the value of `next_analysis_url` and `confirm_delete_url` in the 200 response is `null`. As an example of the deletion process, let's imagine that you added a workflow that configured a particular code scanning tool to analyze the code in a repository. This tool has added 15 analyses: 10 on the default branch, and another 5 on a topic branch. You therefore have two separate sets of analyses for this tool. You've now decided that you want to remove all of the analyses for the tool. To do this you must make 15 separate deletion requests. To start, you must find an analysis that's identified as deletable. Each set of analyses always has one that's identified as deletable. Having found the deletable analysis for one of the two sets, delete this analysis and then continue deleting the next analysis in the set until they're all deleted. Then repeat the process for the second set. The procedure therefore consists of a nested loop: **Outer loop**: * List the analyses for the repository, filtered by tool. * Parse this list to find a deletable analysis. If found: **Inner loop**: * Delete the identified analysis. * Parse the response for the value of `confirm_delete_url` and, if found, use this in the next iteration. The above process assumes that you want to remove all trace of the tool's analyses from the GitHub user interface, for the specified repository, and it therefore uses the `confirm_delete_url` value. Alternatively, you could use the `next_analysis_url` value, which would leave the last analysis in each set undeleted to avoid removing a tool's analysis entirely. OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories. */ export const deleteAnalysis: API.OperationMethod< DeleteAnalysisRequest, CodeScanningAnalysisDeletion, DeleteAnalysisError, GithubOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(800, __c25, 0) as any as S.Schema, output: __S(801, __c25, 1) as any as S.Schema, errors: [], serviceErrors: GithubServiceErrors, protocol: GithubProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "DeleteAnalysis", })); export type DeleteCodeqlDatabaseError = GithubOpError; /** Delete a CodeQL database Deletes a CodeQL database for a language in a repository. OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories. */ export const deleteCodeqlDatabase: API.OperationMethod< DeleteCodeqlDatabaseRequest, DeleteCodeqlDatabaseResponse, DeleteCodeqlDatabaseError, GithubOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(832, __c26, 0) as any as S.Schema, output: __S(864, __c27, 0) as any as S.Schema, errors: [], serviceErrors: GithubServiceErrors, protocol: GithubProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "DeleteCodeqlDatabase", })); export type GetAiScanEnablementError = GithubOpError; /** Get AI Scan enablement for a repository Gets whether AI Scan is enabled for a repository. OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories. */ export const getAiScanEnablement: API.OperationMethod< GetAiScanEnablementRequest, CodeScanningAiScanEnablement, GetAiScanEnablementError, GithubOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(896, __c28, 0) as any as S.Schema, output: __S(928, __c29, 0) as any as S.Schema, errors: [], serviceErrors: GithubServiceErrors, protocol: GithubProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "GetAiScanEnablement", })); export type GetAiScanEnablementForOrgError = GithubOpError; /** Get the AI Scan setting for an organization Gets the AI Scan setting stored on an organization. The response reports the value stored on the organization. Organization respects enterprise policy. The authenticated user must be an owner or security manager for the organization to use this endpoint. OAuth app tokens and personal access tokens (classic) need the `admin:org`, `repo`, or `write:org` scope to use this endpoint. Organization owners can use `admin:org` or `repo`; security managers need `write:org`. */ export const getAiScanEnablementForOrg: API.OperationMethod< GetAiScanEnablementForOrgRequest, CodeScanningAiScanOrgSettings, GetAiScanEnablementForOrgError, GithubOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(960, __c30, 0) as any as S.Schema, output: __S(928, __c29, 0) as any as S.Schema, errors: [], serviceErrors: GithubServiceErrors, protocol: GithubProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "GetAiScanEnablementForOrg", })); export type GetAlertError = GithubOpError; /** Get a code scanning alert Gets a single code scanning alert. OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories. */ export const getAlert: API.OperationMethod< GetAlertRequest, CodeScanningAlert, GetAlertError, GithubOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(992, __c31, 0) as any as S.Schema, output: __S(1107, __c34, 19) as any as S.Schema, errors: [], serviceErrors: GithubServiceErrors, protocol: GithubProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "GetAlert", })); export type GetAnalysisError = GithubOpError; /** Get a code scanning analysis for a repository Gets a specified code scanning analysis for a repository. The default JSON response contains fields that describe the analysis. This includes the Git reference and commit SHA to which the analysis relates, the datetime of the analysis, the name of the code scanning tool, and the number of alerts. The `rules_count` field in the default response give the number of rules that were run in the analysis. For very old analyses this data is not available, and `0` is returned in this field. This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)." - **`application/sarif+json`**: Instead of returning a summary of the analysis, this endpoint returns a subset of the analysis data that was uploaded. The data is formatted as [SARIF version 2.1.0](https://docs.oasis-open.org/sarif/sarif/v2.1.0/cs01/sarif-v2.1.0-cs01.html). It also returns additional data such as the `github/alertNumber` and `github/alertUrl` properties. OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories. */ export const getAnalysis: API.OperationMethod< GetAnalysisRequest, CodeScanningAnalysis, GetAnalysisError, GithubOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(1152, __c36, 0) as any as S.Schema, output: __S(1184, __c37, 0) as any as S.Schema, errors: [], serviceErrors: GithubServiceErrors, protocol: GithubProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "GetAnalysis", })); export type GetAutofixError = GithubOpError; /** Get the status of an autofix for a code scanning alert Gets the status and description of an autofix for a code scanning alert on the repository's default branch. OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories. */ export const getAutofix: API.OperationMethod< GetAutofixRequest, CodeScanningAutofix, GetAutofixError, GithubOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(1216, __c38, 0) as any as S.Schema, output: __S(64, __c2, 0) as any as S.Schema, errors: [], serviceErrors: GithubServiceErrors, protocol: GithubProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "GetAutofix", })); export type GetCodeqlDatabaseError = GithubOpError; /** Get a CodeQL database for a repository Gets a CodeQL database for a language in a repository. By default this endpoint returns JSON metadata about the CodeQL database. To download the CodeQL database binary content, set the `Accept` header of the request to [`application/zip`](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types), and make sure your HTTP client is configured to follow redirects or use the `Location` header to make a second request to get the redirect URL. OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories. */ export const getCodeqlDatabase: API.OperationMethod< GetCodeqlDatabaseRequest, CodeScanningCodeqlDatabase, GetCodeqlDatabaseError, GithubOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(96, __c3, 0) as any as S.Schema, output: __S(128, __c4, 0) as any as S.Schema, errors: [], serviceErrors: GithubServiceErrors, protocol: GithubProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "GetCodeqlDatabase", })); export type GetDefaultSetupError = GithubOpError; /** Get a code scanning default setup configuration Gets a code scanning default setup configuration. OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories. */ export const getDefaultSetup: API.OperationMethod< GetDefaultSetupRequest, CodeScanningDefaultSetup, GetDefaultSetupError, GithubOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(160, __c5, 0) as any as S.Schema, output: __S(161, __c5, 1) as any as S.Schema, errors: [], serviceErrors: GithubServiceErrors, protocol: GithubProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "GetDefaultSetup", })); export type GetSarifError = GithubOpError; /** Get information about a SARIF upload Gets information about a SARIF upload, including the status and the URL of the analysis that was uploaded so that you can retrieve details of the analysis. For more information, see "[Get a code scanning analysis for a repository](/rest/code-scanning/code-scanning#get-a-code-scanning-analysis-for-a-repository)." OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories. */ export const getSarif: API.OperationMethod< GetSarifRequest, CodeScanningSarifsStatus, GetSarifError, GithubOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(224, __c7, 0) as any as S.Schema, output: __S(225, __c7, 1) as any as S.Schema, errors: [], serviceErrors: GithubServiceErrors, protocol: GithubProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "GetSarif", })); export type GetVariantAnalysisError = GithubOpError; /** Get the summary of a CodeQL variant analysis Gets the summary of a CodeQL variant analysis. OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories. */ export const getVariantAnalysis: API.OperationMethod< GetVariantAnalysisRequest, CodeScanningVariantAnalysis, GetVariantAnalysisError, GithubOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(256, __c8, 0) as any as S.Schema, output: __S(519, __c16, 7) as any as S.Schema, errors: [], serviceErrors: GithubServiceErrors, protocol: GithubProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "GetVariantAnalysis", })); export type GetVariantAnalysisRepoTaskError = GithubOpError; /** Get the analysis status of a repository in a CodeQL variant analysis Gets the analysis status of a repository in a CodeQL variant analysis. OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories. */ export const getVariantAnalysisRepoTask: API.OperationMethod< GetVariantAnalysisRepoTaskRequest, CodeScanningVariantAnalysisRepoTask, GetVariantAnalysisRepoTaskError, GithubOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(288, __c9, 0) as any as S.Schema, output: __S(289, __c9, 1) as any as S.Schema, errors: [], serviceErrors: GithubServiceErrors, protocol: GithubProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "GetVariantAnalysisRepoTask", })); export type ListAlertInstancesError = GithubOpError; /** List instances of a code scanning alert Lists all instances of the specified code scanning alert. OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories. */ export const listAlertInstances: API.PaginatedOperationMethod< ListAlertInstancesRequest, ListAlertInstancesResponse, ListAlertInstancesError, GithubOpContext, CodeScanningAlertInstanceList > = /*@__PURE__*/ API.makePaginated( () => ({ input: __S(320, __c10, 0) as any as S.Schema, output: __S(324, __c10, 4) as any as S.Schema, errors: [], serviceErrors: GithubServiceErrors, protocol: GithubProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "ListAlertInstances", pagination: { mode: "link", inputToken: "page", pageSize: "per_page", items: "body" } as const, }), paginateLink, ) as any; export type ListAlertsForOrgError = GithubOpError; /** List code scanning alerts for an organization Lists code scanning alerts for the default branch for all eligible repositories in an organization. Eligible repositories are repositories that are owned by organizations that you own or for which you are a security manager. For more information, see "[Managing security managers in your organization](https://docs.github.com/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)." The authenticated user must be an owner or security manager for the organization to use this endpoint. OAuth app tokens and personal access tokens (classic) need the `security_events` or `repo`s cope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories. */ export const listAlertsForOrg: API.PaginatedOperationMethod< ListAlertsForOrgRequest, ListAlertsForOrgResponse, ListAlertsForOrgError, GithubOpContext, CodeScanningOrganizationAlertItems > = /*@__PURE__*/ API.makePaginated( () => ({ input: __S(352, __c11, 0) as any as S.Schema, output: __S(355, __c11, 3) as any as S.Schema, errors: [], serviceErrors: GithubServiceErrors, protocol: GithubProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "ListAlertsForOrg", pagination: { mode: "link", inputToken: "page", pageSize: "per_page", items: "body" } as const, }), paginateLink, ) as any; export type ListAlertsForRepoError = GithubOpError; /** List code scanning alerts for a repository Lists code scanning alerts. The response includes a `most_recent_instance` object. This provides details of the most recent instance of this alert for the default branch (or for the specified Git reference if you used `ref` in the request). OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories. */ export const listAlertsForRepo: API.PaginatedOperationMethod< ListAlertsForRepoRequest, ListAlertsForRepoResponse, ListAlertsForRepoError, GithubOpContext, CodeScanningAlertItems > = /*@__PURE__*/ API.makePaginated( () => ({ input: __S(384, __c12, 0) as any as S.Schema, output: __S(387, __c12, 3) as any as S.Schema, errors: [], serviceErrors: GithubServiceErrors, protocol: GithubProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "ListAlertsForRepo", pagination: { mode: "link", inputToken: "page", pageSize: "per_page", items: "body" } as const, }), paginateLink, ) as any; export type ListCodeqlDatabasesError = GithubOpError; /** List CodeQL databases for a repository Lists the CodeQL databases that are available in a repository. OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories. */ export const listCodeqlDatabases: API.OperationMethod< ListCodeqlDatabasesRequest, ListCodeqlDatabasesResponse, ListCodeqlDatabasesError, GithubOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(416, __c13, 0) as any as S.Schema, output: __S(418, __c13, 2) as any as S.Schema, errors: [], serviceErrors: GithubServiceErrors, protocol: GithubProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "ListCodeqlDatabases", })); export type ListRecentAnalysesError = GithubOpError; /** List code scanning analyses for a repository Lists the details of all code scanning analyses for a repository, starting with the most recent. The response is paginated and you can use the `page` and `per_page` parameters to list the analyses you're interested in. By default 30 analyses are listed per page. The `rules_count` field in the response give the number of rules that were run in the analysis. For very old analyses this data is not available, and `0` is returned in this field. > [!WARNING] > **Closing down notice:** The `tool_name` field is closing down and will, in future, not be included in the response for this endpoint. The example response reflects this change. The tool name can now be found inside the `tool` field. OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories. */ export const listRecentAnalyses: API.PaginatedOperationMethod< ListRecentAnalysesRequest, ListRecentAnalysesResponse, ListRecentAnalysesError, GithubOpContext, CodeScanningAnalysis > = /*@__PURE__*/ API.makePaginated( () => ({ input: __S(448, __c14, 0) as any as S.Schema, output: __S(450, __c14, 2) as any as S.Schema, errors: [], serviceErrors: GithubServiceErrors, protocol: GithubProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "ListRecentAnalyses", pagination: { mode: "link", inputToken: "page", pageSize: "per_page", items: "body" } as const, }), paginateLink, ) as any; export type UpdateAiScanEnablementError = GithubOpError; /** Update AI Scan enablement for a repository Updates whether AI Scan is enabled for a repository. OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories. */ export const updateAiScanEnablement: API.OperationMethod< UpdateAiScanEnablementRequest, CodeScanningAiScanEnablement, UpdateAiScanEnablementError, GithubOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(640, __c20, 0) as any as S.Schema, output: __S(928, __c29, 0) as any as S.Schema, errors: [], serviceErrors: GithubServiceErrors, protocol: GithubProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "UpdateAiScanEnablement", })); export type UpdateAiScanEnablementForOrgError = GithubOpError; /** Update the AI Scan setting for an organization Updates the AI Scan setting stored on an organization. The organization respects the enterprise policy, so enabling is rejected when the enterprise disallows AI Scan. OAuth app tokens and personal access tokens (classic) need the `admin:org`, `repo`, or `write:org` scope to use this endpoint. Organization owners can use `admin:org` or `repo`; security managers need `write:org`. */ export const updateAiScanEnablementForOrg: API.OperationMethod< UpdateAiScanEnablementForOrgRequest, CodeScanningAiScanOrgSettings, UpdateAiScanEnablementForOrgError, GithubOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(672, __c21, 0) as any as S.Schema, output: __S(928, __c29, 0) as any as S.Schema, errors: [], serviceErrors: GithubServiceErrors, protocol: GithubProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "UpdateAiScanEnablementForOrg", })); export type UpdateAlertError = GithubOpError; /** Update a code scanning alert Updates the status of a single code scanning alert. OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories. */ export const updateAlert: API.OperationMethod< UpdateAlertRequest, CodeScanningAlert, UpdateAlertError, GithubOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(704, __c22, 0) as any as S.Schema, output: __S(1107, __c34, 19) as any as S.Schema, errors: [], serviceErrors: GithubServiceErrors, protocol: GithubProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "UpdateAlert", })); export type UpdateDefaultSetupError = GithubOpError; /** Update a code scanning default setup configuration Updates a code scanning default setup configuration. OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories. */ export const updateDefaultSetup: API.OperationMethod< UpdateDefaultSetupRequest, UpdateDefaultSetupResponse, UpdateDefaultSetupError, GithubOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(736, __c23, 0) as any as S.Schema, output: __S(737, __c23, 1) as any as S.Schema, errors: [], serviceErrors: GithubServiceErrors, protocol: GithubProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "UpdateDefaultSetup", })); export type UploadSarifError = GithubOpError; /** Upload an analysis as SARIF data Uploads SARIF data containing the results of a code scanning analysis to make the results available in a repository. For troubleshooting information, see "[Troubleshooting SARIF uploads](https://docs.github.com/code-security/code-scanning/troubleshooting-sarif)." There are two places where you can upload code scanning results. - If you upload to a pull request, for example `--ref refs/pull/42/merge` or `--ref refs/pull/42/head`, then the results appear as alerts in a pull request check. For more information, see "[Triaging code scanning alerts in pull requests](/code-security/secure-coding/triaging-code-scanning-alerts-in-pull-requests)." - If you upload to a branch, for example `--ref refs/heads/my-branch`, then the results appear in the **Security** tab for your repository. For more information, see "[Managing code scanning alerts for your repository](/code-security/secure-coding/managing-code-scanning-alerts-for-your-repository#viewing-the-alerts-for-a-repository)." You must compress the SARIF-formatted analysis data that you want to upload, using `gzip`, and then encode it as a Base64 format string. For example: ``` gzip -c analysis-data.sarif | base64 -w0 ``` SARIF upload supports a maximum number of entries per the following data objects, and an analysis will be rejected if any of these objects is above its maximum value. For some objects, there are additional values over which the entries will be ignored while keeping the most important entries whenever applicable. To get the most out of your analysis when it includes data above the supported limits, try to optimize the analysis configuration. For example, for the CodeQL tool, identify and remove the most noisy queries. For more information, see "[SARIF results exceed one or more limits](https://docs.github.com/code-security/code-scanning/troubleshooting-sarif/results-exceed-limit)." The `202 Accepted` response includes an `id` value. You can use this ID to check the status of the upload by using it in the `/sarifs/{sarif_id}` endpoint. For more information, see "[Get information about a SARIF upload](/rest/code-scanning/code-scanning#get-information-about-a-sarif-upload)." OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories. This endpoint is limited to 1,000 requests per hour for each user or app installation calling it. */ export const uploadSarif: API.OperationMethod< UploadSarifRequest, UploadSarifResponse, UploadSarifError, GithubOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(768, __c24, 0) as any as S.Schema, output: __S(864, __c27, 0) as any as S.Schema, errors: [], serviceErrors: GithubServiceErrors, protocol: GithubProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "UploadSarif", })); // Schema builders: each runs one schema initializer, on that schema's first use. function __c0(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ owner: S.String.pipe(T.Label()), repo: S.String.pipe(T.Label()), alert_number: S.Number.pipe(T.Label()), target_ref: S.optional(S.String), message: S.optional(S.String), }).pipe( T.Http({ method: "POST", uri: "/repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix/commits", code: 200, }), ), ).annotate({ identifier: "CommitAutofixRequest" }); case 1: return S.suspend(() => S.Struct({ target_ref: S.optional(S.String), sha: S.optional(S.String), }), ).annotate({ identifier: "CodeScanningAutofixCommitsResponse" }); } } function __c1(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ owner: S.String.pipe(T.Label()), repo: S.String.pipe(T.Label()), alert_number: S.Number.pipe(T.Label()), }).pipe( T.Http({ method: "POST", uri: "/repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix", code: 200, }), ), ).annotate({ identifier: "CreateAutofixRequest" }); } } function __c2(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ status: S.String, description: S.NullOr(S.String), started_at: S.String, }), ).annotate({ identifier: "CodeScanningAutofix" }); } } function __c3(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ owner: S.String.pipe(T.Label()), repo: S.String.pipe(T.Label()), language: S.String.pipe(T.Label()), }).pipe( T.Http({ method: "GET", uri: "/repos/{owner}/{repo}/code-scanning/codeql/databases/{language}", code: 200, }), ), ).annotate({ identifier: "GetCodeqlDatabaseRequest" }); } } function __c4(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ id: S.Number, name: S.String, language: S.String, uploader: __S(576, __c18, 0), content_type: S.String, size: S.Number, created_at: S.String, updated_at: S.String, url: S.String, commit_oid: S.optional(S.NullOr(S.String)), }), ).annotate({ identifier: "CodeScanningCodeqlDatabase" }); } } function __c5(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ owner: S.String.pipe(T.Label()), repo: S.String.pipe(T.Label()), }).pipe( T.Http({ method: "GET", uri: "/repos/{owner}/{repo}/code-scanning/default-setup", code: 200, }), ), ).annotate({ identifier: "GetDefaultSetupRequest" }); case 1: return S.suspend(() => S.Struct({ state: S.optional(S.String), languages: S.optional(__S(192, __c6, 0)), runner_type: S.optional(S.NullOr(S.String)), runner_label: S.optional(S.NullOr(S.String)), query_suite: S.optional(S.String), threat_model: S.optional(S.String), updated_at: S.optional(S.NullOr(S.String)), schedule: S.optional(S.NullOr(S.String)), }), ).annotate({ identifier: "CodeScanningDefaultSetup" }); } } function __c6(j: number): any { switch (j) { case 0: return S.Array(S.String); } } function __c7(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ owner: S.String.pipe(T.Label()), repo: S.String.pipe(T.Label()), sarif_id: S.String.pipe(T.Label()), }).pipe( T.Http({ method: "GET", uri: "/repos/{owner}/{repo}/code-scanning/sarifs/{sarif_id}", code: 200, }), ), ).annotate({ identifier: "GetSarifRequest" }); case 1: return S.suspend(() => S.Struct({ processing_status: S.optional(S.String), analyses_url: S.optional(S.NullOr(S.String)), errors: S.optional(S.NullOr(__S(608, __c19, 0))), }), ).annotate({ identifier: "CodeScanningSarifsStatus" }); } } function __c8(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ owner: S.String.pipe(T.Label()), repo: S.String.pipe(T.Label()), codeql_variant_analysis_id: S.Number.pipe(T.Label()), }).pipe( T.Http({ method: "GET", uri: "/repos/{owner}/{repo}/code-scanning/codeql/variant-analyses/{codeql_variant_analysis_id}", code: 200, }), ), ).annotate({ identifier: "GetVariantAnalysisRequest" }); } } function __c9(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ owner: S.String.pipe(T.Label()), repo: S.String.pipe(T.Label()), codeql_variant_analysis_id: S.Number.pipe(T.Label()), repo_owner: S.String.pipe(T.Label()), repo_name: S.String.pipe(T.Label()), }).pipe( T.Http({ method: "GET", uri: "/repos/{owner}/{repo}/code-scanning/codeql/variant-analyses/{codeql_variant_analysis_id}/repos/{repo_owner}/{repo_name}", code: 200, }), ), ).annotate({ identifier: "GetVariantAnalysisRepoTaskRequest" }); case 1: return S.suspend(() => S.Struct({ repository: __S(544, __c17, 0), analysis_status: S.String, artifact_size_in_bytes: S.optional(S.Number), result_count: S.optional(S.Number), failure_message: S.optional(S.String), database_commit_sha: S.optional(S.String), source_location_prefix: S.optional(S.String), artifact_url: S.optional(S.String), }), ).annotate({ identifier: "CodeScanningVariantAnalysisRepoTask" }); } } function __c10(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ owner: S.String.pipe(T.Label()), repo: S.String.pipe(T.Label()), alert_number: S.Number.pipe(T.Label()), page: S.optional(S.Number.pipe(T.Query())), per_page: S.optional(S.Number.pipe(T.Query())), ref: S.optional(S.String.pipe(T.Query())), pr: S.optional(S.Number.pipe(T.Query())), }).pipe( T.Http({ method: "GET", uri: "/repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances", code: 200, }), ), ).annotate({ identifier: "ListAlertInstancesRequest" }); case 1: return S.suspend(() => S.Struct({ text: S.optional(S.String), }), ).annotate({ identifier: "CodeScanningAlertInstanceListMessage" }); case 2: return S.suspend(() => S.Struct({ ref: S.optional(S.String), analysis_key: S.optional(S.String), environment: S.optional(S.String), category: S.optional(S.String), state: S.optional(S.NullOr(S.String)), commit_sha: S.optional(S.String), message: S.optional(__S(321, __c10, 1)), location: S.optional(__S(1024, __c32, 0)), html_url: S.optional(S.String), classifications: S.optional(__S(1025, __c32, 1)), }), ).annotate({ identifier: "CodeScanningAlertInstanceList" }); case 3: return S.Array(__S(322, __c10, 2)); case 4: return S.suspend(() => __S(323, __c10, 3).pipe(T.RawResponseRoot())).annotate({ identifier: "ListAlertInstancesResponse", }); } } function __c11(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ org: S.String.pipe(T.Label()), tool_name: S.optional(S.String.pipe(T.Query())), tool_guid: S.optional(S.String.pipe(T.Query())), before: S.optional(S.String.pipe(T.Query())), after: S.optional(S.String.pipe(T.Query())), page: S.optional(S.Number.pipe(T.Query())), per_page: S.optional(S.Number.pipe(T.Query())), direction: S.optional(S.String.pipe(T.Query())), state: S.optional(S.String.pipe(T.Query())), sort: S.optional(S.String.pipe(T.Query())), severity: S.optional(S.String.pipe(T.Query())), assignees: S.optional(S.String.pipe(T.Query())), }).pipe(T.Http({ method: "GET", uri: "/orgs/{org}/code-scanning/alerts", code: 200 })), ).annotate({ identifier: "ListAlertsForOrgRequest" }); case 1: return S.suspend(() => S.Struct({ number: S.Number, created_at: S.String, updated_at: S.optional(S.String), url: S.String, html_url: S.String, instances_url: S.String, state: S.NullOr(S.String), fixed_at: S.optional(S.NullOr(S.String)), dismissed_by: S.NullOr(__S(576, __c18, 0)), dismissed_at: S.NullOr(S.String), dismissed_reason: S.NullOr(S.String), dismissed_comment: S.optional(S.NullOr(S.String)), rule: __S(1056, __c33, 0), tool: __S(1120, __c35, 0), most_recent_instance: __S(1058, __c33, 2), repository: __S(544, __c17, 0), dismissal_approved_by: S.optional(S.NullOr(__S(576, __c18, 0))), assignees: S.optional(__S(1059, __c33, 3)), }), ).annotate({ identifier: "CodeScanningOrganizationAlertItems" }); case 2: return S.Array(__S(353, __c11, 1)); case 3: return S.suspend(() => __S(354, __c11, 2).pipe(T.RawResponseRoot())).annotate({ identifier: "ListAlertsForOrgResponse", }); } } function __c12(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ owner: S.String.pipe(T.Label()), repo: S.String.pipe(T.Label()), tool_name: S.optional(S.String.pipe(T.Query())), tool_guid: S.optional(S.String.pipe(T.Query())), page: S.optional(S.Number.pipe(T.Query())), per_page: S.optional(S.Number.pipe(T.Query())), ref: S.optional(S.String.pipe(T.Query())), pr: S.optional(S.Number.pipe(T.Query())), direction: S.optional(S.String.pipe(T.Query())), before: S.optional(S.String.pipe(T.Query())), after: S.optional(S.String.pipe(T.Query())), sort: S.optional(S.String.pipe(T.Query())), state: S.optional(S.String.pipe(T.Query())), severity: S.optional(S.String.pipe(T.Query())), assignees: S.optional(S.String.pipe(T.Query())), }).pipe( T.Http({ method: "GET", uri: "/repos/{owner}/{repo}/code-scanning/alerts", code: 200 }), ), ).annotate({ identifier: "ListAlertsForRepoRequest" }); case 1: return S.suspend(() => S.Struct({ number: S.Number, created_at: S.String, updated_at: S.optional(S.String), url: S.String, html_url: S.String, instances_url: S.String, state: S.NullOr(S.String), fixed_at: S.optional(S.NullOr(S.String)), dismissed_by: S.NullOr(__S(576, __c18, 0)), dismissed_at: S.NullOr(S.String), dismissed_reason: S.NullOr(S.String), dismissed_comment: S.optional(S.NullOr(S.String)), rule: __S(1056, __c33, 0), tool: __S(1120, __c35, 0), most_recent_instance: __S(1058, __c33, 2), dismissal_approved_by: S.optional(S.NullOr(__S(576, __c18, 0))), assignees: S.optional(__S(1059, __c33, 3)), }), ).annotate({ identifier: "CodeScanningAlertItems" }); case 2: return S.Array(__S(385, __c12, 1)); case 3: return S.suspend(() => __S(386, __c12, 2).pipe(T.RawResponseRoot())).annotate({ identifier: "ListAlertsForRepoResponse", }); } } function __c13(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ owner: S.String.pipe(T.Label()), repo: S.String.pipe(T.Label()), }).pipe( T.Http({ method: "GET", uri: "/repos/{owner}/{repo}/code-scanning/codeql/databases", code: 200, }), ), ).annotate({ identifier: "ListCodeqlDatabasesRequest" }); case 1: return S.Array(__S(128, __c4, 0)); case 2: return S.suspend(() => __S(417, __c13, 1).pipe(T.RawResponseRoot())).annotate({ identifier: "ListCodeqlDatabasesResponse", }); } } function __c14(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ owner: S.String.pipe(T.Label()), repo: S.String.pipe(T.Label()), tool_name: S.optional(S.String.pipe(T.Query())), tool_guid: S.optional(S.String.pipe(T.Query())), page: S.optional(S.Number.pipe(T.Query())), per_page: S.optional(S.Number.pipe(T.Query())), pr: S.optional(S.Number.pipe(T.Query())), ref: S.optional(S.String.pipe(T.Query())), sarif_id: S.optional(S.String.pipe(T.Query())), direction: S.optional(S.String.pipe(T.Query())), sort: S.optional(S.String.pipe(T.Query())), }).pipe( T.Http({ method: "GET", uri: "/repos/{owner}/{repo}/code-scanning/analyses", code: 200 }), ), ).annotate({ identifier: "ListRecentAnalysesRequest" }); case 1: return S.Array(__S(1184, __c37, 0)); case 2: return S.suspend(() => __S(449, __c14, 1).pipe(T.RawResponseRoot())).annotate({ identifier: "ListRecentAnalysesResponse", }); } } function __c15(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ owner: S.String.pipe(T.Label()), repo: S.String.pipe(T.Label()), language: S.String, query_pack: S.String, repositories: S.optional(__S(608, __c19, 0)), repository_lists: S.optional(__S(608, __c19, 0)), repository_owners: S.optional(__S(608, __c19, 0)), }).pipe( T.Http({ method: "POST", uri: "/repos/{owner}/{repo}/code-scanning/codeql/variant-analyses", code: 200, }), ), ).annotate({ identifier: "CreateVariantAnalysisRequest" }); } } function __c16(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ id: S.Number, name: S.String, full_name: S.String, private: S.Boolean, stargazers_count: S.Number, updated_at: S.NullOr(S.String), }), ).annotate({ identifier: "CodeScanningVariantAnalysisRepository" }); case 1: return S.suspend(() => S.Struct({ repository: __S(512, __c16, 0), analysis_status: S.String, result_count: S.optional(S.Number), artifact_size_in_bytes: S.optional(S.Number), failure_message: S.optional(S.String), }), ).annotate({ identifier: "CodeScanningVariantAnalysisScannedRepositoriesItem" }); case 2: return S.Array(__S(513, __c16, 1)); case 3: return S.Array(__S(512, __c16, 0)); case 4: return S.suspend(() => S.Struct({ repository_count: S.Number, repositories: __S(515, __c16, 3), }), ).annotate({ identifier: "CodeScanningVariantAnalysisSkippedRepoGroup" }); case 5: return S.suspend(() => S.Struct({ repository_count: S.Number, repository_full_names: __S(608, __c19, 0), }), ).annotate({ identifier: "CodeScanningVariantAnalysisSkippedRepositoriesNotFoundRepos" }); case 6: return S.suspend(() => S.Struct({ access_mismatch_repos: __S(516, __c16, 4), not_found_repos: __S(517, __c16, 5), no_codeql_db_repos: __S(516, __c16, 4), over_limit_repos: __S(516, __c16, 4), }), ).annotate({ identifier: "CodeScanningVariantAnalysisSkippedRepositories" }); case 7: return S.suspend(() => S.Struct({ id: S.Number, controller_repo: __S(544, __c17, 0), actor: __S(576, __c18, 0), query_language: S.String, query_pack_url: S.String, created_at: S.optional(S.String), updated_at: S.optional(S.String), completed_at: S.optional(S.NullOr(S.String)), status: S.String, actions_workflow_run_id: S.optional(S.Number), failure_reason: S.optional(S.String), scanned_repositories: S.optional(__S(514, __c16, 2)), skipped_repositories: S.optional(__S(518, __c16, 6)), }), ).annotate({ identifier: "CodeScanningVariantAnalysis" }); } } function __c17(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ id: S.Number, node_id: S.String, name: S.String, full_name: S.String, owner: __S(576, __c18, 0), private: S.Boolean, html_url: S.String, description: S.NullOr(S.String), fork: S.Boolean, url: S.String, archive_url: S.String, assignees_url: S.String, blobs_url: S.String, branches_url: S.String, collaborators_url: S.String, comments_url: S.String, commits_url: S.String, compare_url: S.String, contents_url: S.String, contributors_url: S.String, deployments_url: S.String, downloads_url: S.String, events_url: S.String, forks_url: S.String, git_commits_url: S.String, git_refs_url: S.String, git_tags_url: S.String, issue_comment_url: S.String, issue_events_url: S.String, issues_url: S.String, keys_url: S.String, labels_url: S.String, languages_url: S.String, merges_url: S.String, milestones_url: S.String, notifications_url: S.String, pulls_url: S.String, releases_url: S.String, stargazers_url: S.String, statuses_url: S.String, subscribers_url: S.String, subscription_url: S.String, tags_url: S.String, teams_url: S.String, trees_url: S.String, hooks_url: S.String, }), ).annotate({ identifier: "SimpleRepository" }); } } function __c18(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ name: S.optional(S.NullOr(S.String)), email: S.optional(S.NullOr(S.String)), login: S.String, id: S.Number, node_id: S.String, avatar_url: S.String, gravatar_id: S.NullOr(S.String), url: S.String, html_url: S.String, followers_url: S.String, following_url: S.String, gists_url: S.String, starred_url: S.String, subscriptions_url: S.String, organizations_url: S.String, repos_url: S.String, events_url: S.String, received_events_url: S.String, type: S.String, site_admin: S.Boolean, starred_at: S.optional(S.String), user_view_type: S.optional(S.String), }), ).annotate({ identifier: "SimpleUser" }); } } function __c19(j: number): any { switch (j) { case 0: return S.Array(S.String); } } function __c20(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ owner: S.String.pipe(T.Label()), repo: S.String.pipe(T.Label()), pr_scan: S.optional(S.String), }).pipe( T.Http({ method: "PATCH", uri: "/repos/{owner}/{repo}/code-scanning/ai-scan", code: 200, }), ), ).annotate({ identifier: "UpdateAiScanEnablementRequest" }); } } function __c21(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ org: S.String.pipe(T.Label()), pr_scan: S.optional(S.String), }).pipe(T.Http({ method: "PATCH", uri: "/orgs/{org}/code-scanning/ai-scan", code: 200 })), ).annotate({ identifier: "UpdateAiScanEnablementForOrgRequest" }); } } function __c22(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ owner: S.String.pipe(T.Label()), repo: S.String.pipe(T.Label()), alert_number: S.Number.pipe(T.Label()), state: S.optional(S.String), dismissed_reason: S.optional(S.NullOr(S.String)), dismissed_comment: S.optional(S.NullOr(S.String)), create_request: S.optional(S.Boolean), assignees: S.optional(__S(608, __c19, 0)), }).pipe( T.Http({ method: "PATCH", uri: "/repos/{owner}/{repo}/code-scanning/alerts/{alert_number}", code: 200, }), ), ).annotate({ identifier: "UpdateAlertRequest" }); } } function __c23(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ owner: S.String.pipe(T.Label()), repo: S.String.pipe(T.Label()), state: S.optional(S.String), runner_type: S.optional(S.String), runner_label: S.optional(S.NullOr(S.String)), query_suite: S.optional(S.String), threat_model: S.optional(S.String), languages: S.optional(__S(192, __c6, 0)), }).pipe( T.Http({ method: "PATCH", uri: "/repos/{owner}/{repo}/code-scanning/default-setup", code: 200, }), ), ).annotate({ identifier: "UpdateDefaultSetupRequest" }); case 1: return S.suspend(() => S.Unknown.pipe(T.RawResponseRoot())).annotate({ identifier: "UpdateDefaultSetupResponse", }); } } function __c24(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ owner: S.String.pipe(T.Label()), repo: S.String.pipe(T.Label()), commit_sha: S.String, ref: S.String, sarif: S.String, checkout_uri: S.optional(S.String), started_at: S.optional(S.String), tool_name: S.optional(S.String), validate: S.optional(S.Boolean), }).pipe( T.Http({ method: "POST", uri: "/repos/{owner}/{repo}/code-scanning/sarifs", code: 200 }), ), ).annotate({ identifier: "UploadSarifRequest" }); } } function __c25(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ owner: S.String.pipe(T.Label()), repo: S.String.pipe(T.Label()), analysis_id: S.Number.pipe(T.Label()), confirm_delete: S.optional(S.String.pipe(T.Query())), }).pipe( T.Http({ method: "DELETE", uri: "/repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}", code: 200, }), ), ).annotate({ identifier: "DeleteAnalysisRequest" }); case 1: return S.suspend(() => S.Struct({ next_analysis_url: S.NullOr(S.String), confirm_delete_url: S.NullOr(S.String), }), ).annotate({ identifier: "CodeScanningAnalysisDeletion" }); } } function __c26(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ owner: S.String.pipe(T.Label()), repo: S.String.pipe(T.Label()), language: S.String.pipe(T.Label()), }).pipe( T.Http({ method: "DELETE", uri: "/repos/{owner}/{repo}/code-scanning/codeql/databases/{language}", code: 200, }), ), ).annotate({ identifier: "DeleteCodeqlDatabaseRequest" }); } } function __c27(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({})).annotate({ identifier: "DeleteCodeqlDatabaseResponse" }); } } function __c28(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ owner: S.String.pipe(T.Label()), repo: S.String.pipe(T.Label()), }).pipe( T.Http({ method: "GET", uri: "/repos/{owner}/{repo}/code-scanning/ai-scan", code: 200 }), ), ).annotate({ identifier: "GetAiScanEnablementRequest" }); } } function __c29(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ pr_scan: S.String, }), ).annotate({ identifier: "CodeScanningAiScanEnablement" }); } } function __c30(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ org: S.String.pipe(T.Label()), }).pipe(T.Http({ method: "GET", uri: "/orgs/{org}/code-scanning/ai-scan", code: 200 })), ).annotate({ identifier: "GetAiScanEnablementForOrgRequest" }); } } function __c31(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ owner: S.String.pipe(T.Label()), repo: S.String.pipe(T.Label()), alert_number: S.Number.pipe(T.Label()), }).pipe( T.Http({ method: "GET", uri: "/repos/{owner}/{repo}/code-scanning/alerts/{alert_number}", code: 200, }), ), ).annotate({ identifier: "GetAlertRequest" }); } } function __c32(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ path: S.optional(S.String), start_line: S.optional(S.Number), end_line: S.optional(S.Number), start_column: S.optional(S.Number), end_column: S.optional(S.Number), }), ).annotate({ identifier: "CodeScanningAlertLocation" }); case 1: return S.Array(/*@__PURE__*/ S.NullOr(S.String)); } } function __c33(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ id: S.optional(S.NullOr(S.String)), name: S.optional(S.String), severity: S.optional(S.NullOr(S.String)), security_severity_level: S.optional(S.NullOr(S.String)), description: S.optional(S.String), full_description: S.optional(S.String), tags: S.optional(S.NullOr(__S(608, __c19, 0))), help: S.optional(S.NullOr(S.String)), help_uri: S.optional(S.NullOr(S.String)), }), ).annotate({ identifier: "CodeScanningAlertRule" }); case 1: return S.suspend(() => S.Struct({ text: S.optional(S.String), markdown: S.optional(S.String), }), ).annotate({ identifier: "CodeScanningAlertInstanceMessage" }); case 2: return S.suspend(() => S.Struct({ ref: S.optional(S.String), analysis_key: S.optional(S.String), environment: S.optional(S.String), category: S.optional(S.String), state: S.optional(S.NullOr(S.String)), commit_sha: S.optional(S.String), message: S.optional(__S(1057, __c33, 1)), location: S.optional(__S(1024, __c32, 0)), html_url: S.optional(S.String), classifications: S.optional(__S(1025, __c32, 1)), }), ).annotate({ identifier: "CodeScanningAlertInstance" }); case 3: return S.Array(__S(576, __c18, 0)); } } function __c34(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ id: S.Number, node_id: S.String, url: S.String, name: S.String, description: S.String, color: S.String, default: S.Boolean, archived_by: S.NullOr(__S(576, __c18, 0)), }), ).annotate({ identifier: "PullRequestSimpleLabelsItem" }); case 1: return S.Array(__S(1088, __c34, 0)); case 2: return S.suspend(() => S.Struct({ url: S.String, html_url: S.String, labels_url: S.String, id: S.Number, node_id: S.String, number: S.Number, state: S.String, title: S.String, description: S.NullOr(S.String), creator: S.NullOr(__S(576, __c18, 0)), open_issues: S.Number, closed_issues: S.Number, created_at: S.String, updated_at: S.String, closed_at: S.NullOr(S.String), due_on: S.NullOr(S.String), }), ).annotate({ identifier: "NullableMilestone" }); case 3: return S.suspend(() => S.Struct({ pull: S.Boolean, triage: S.Boolean, push: S.Boolean, maintain: S.Boolean, admin: S.Boolean, }), ).annotate({ identifier: "TeamPermissions" }); case 4: return S.suspend(() => S.Struct({ id: S.Number, node_id: S.String, url: S.String, members_url: S.String, name: S.String, description: S.NullOr(S.String), permission: S.String, privacy: S.optional(S.String), notification_setting: S.optional(S.String), html_url: S.String, repositories_url: S.String, slug: S.String, ldap_dn: S.optional(S.String), type: S.String, organization_id: S.optional(S.Number), enterprise_id: S.optional(S.Number), }), ).annotate({ identifier: "NullableTeamSimple" }); case 5: return S.suspend(() => S.Struct({ id: S.Number, node_id: S.String, name: S.String, slug: S.String, description: S.NullOr(S.String), privacy: S.optional(S.String), notification_setting: S.optional(S.String), permission: S.String, permissions: S.optional(__S(1091, __c34, 3)), url: S.String, html_url: S.String, members_url: S.String, repositories_url: S.String, type: S.String, access_source: S.optional(S.String), organization_id: S.optional(S.Number), enterprise_id: S.optional(S.Number), parent: S.NullOr(__S(1092, __c34, 4)), }), ).annotate({ identifier: "Team" }); case 6: return S.Array(__S(1093, __c34, 5)); case 7: return S.suspend(() => S.Struct({ key: S.String, name: S.String, url: S.NullOr(S.String), spdx_id: S.NullOr(S.String), node_id: S.String, html_url: S.optional(S.String), }), ).annotate({ identifier: "NullableLicenseSimple" }); case 8: return S.suspend(() => S.Struct({ admin: S.Boolean, pull: S.Boolean, triage: S.optional(S.Boolean), push: S.Boolean, maintain: S.optional(S.Boolean), }), ).annotate({ identifier: "RepositoryPermissions" }); case 9: return S.suspend(() => S.Struct({ lexical_search_ok: S.optional(S.Boolean), lexical_commit_sha: S.optional(S.String), }), ).annotate({ identifier: "RepositoryCodeSearchIndexStatus" }); case 10: return S.suspend(() => S.Struct({ id: S.Number, node_id: S.String, name: S.String, full_name: S.String, license: S.NullOr(__S(1095, __c34, 7)), forks: S.Number, permissions: S.optional(__S(1096, __c34, 8)), owner: __S(576, __c18, 0), private: S.Boolean, html_url: S.String, description: S.NullOr(S.String), fork: S.Boolean, url: S.String, archive_url: S.String, assignees_url: S.String, blobs_url: S.String, branches_url: S.String, collaborators_url: S.String, comments_url: S.String, commits_url: S.String, compare_url: S.String, contents_url: S.String, contributors_url: S.String, deployments_url: S.String, downloads_url: S.String, events_url: S.String, forks_url: S.String, git_commits_url: S.String, git_refs_url: S.String, git_tags_url: S.String, git_url: S.String, issue_comment_url: S.String, issue_events_url: S.String, issues_url: S.String, keys_url: S.String, labels_url: S.String, languages_url: S.String, merges_url: S.String, milestones_url: S.String, notifications_url: S.String, pulls_url: S.String, releases_url: S.String, ssh_url: S.String, stargazers_url: S.String, statuses_url: S.String, subscribers_url: S.String, subscription_url: S.String, tags_url: S.String, teams_url: S.String, trees_url: S.String, clone_url: S.String, mirror_url: S.NullOr(S.String), hooks_url: S.String, svn_url: S.String, homepage: S.NullOr(S.String), language: S.NullOr(S.String), forks_count: S.Number, stargazers_count: S.Number, watchers_count: S.Number, size: S.Number, default_branch: S.String, open_issues_count: S.Number, is_template: S.optional(S.Boolean), topics: S.optional(__S(608, __c19, 0)), has_issues: S.Boolean, has_projects: S.Boolean, has_wiki: S.Boolean, has_pages: S.Boolean, has_downloads: S.Boolean, has_discussions: S.optional(S.Boolean), has_pull_requests: S.optional(S.Boolean), pull_request_creation_policy: S.optional(S.String), archived: S.Boolean, disabled: S.Boolean, visibility: S.optional(S.String), pushed_at: S.NullOr(S.String), created_at: S.NullOr(S.String), updated_at: S.NullOr(S.String), allow_rebase_merge: S.optional(S.Boolean), temp_clone_token: S.optional(S.String.pipe(T.SensitiveValue({}))), allow_squash_merge: S.optional(S.Boolean), allow_auto_merge: S.optional(S.Boolean), delete_branch_on_merge: S.optional(S.Boolean), allow_update_branch: S.optional(S.Boolean), use_squash_pr_title_as_default: S.optional(S.Boolean), squash_merge_commit_title: S.optional(S.String), squash_merge_commit_message: S.optional(S.String), merge_commit_title: S.optional(S.String), merge_commit_message: S.optional(S.String), allow_merge_commit: S.optional(S.Boolean), allow_forking: S.optional(S.Boolean), web_commit_signoff_required: S.optional(S.Boolean), open_issues: S.Number, watchers: S.Number, master_branch: S.optional(S.String), starred_at: S.optional(S.String), anonymous_access_enabled: S.optional(S.Boolean), code_search_index_status: S.optional(__S(1097, __c34, 9)), }), ).annotate({ identifier: "Repository" }); case 11: return S.suspend(() => S.Struct({ label: S.String, ref: S.String, repo: __S(1098, __c34, 10), sha: S.String, user: S.NullOr(__S(576, __c18, 0)), }), ).annotate({ identifier: "PullRequestSimpleHead" }); case 12: return S.suspend(() => S.Struct({ href: S.String, }), ).annotate({ identifier: "Link" }); case 13: return S.suspend(() => S.Struct({ comments: __S(1100, __c34, 12), commits: __S(1100, __c34, 12), statuses: __S(1100, __c34, 12), html: __S(1100, __c34, 12), issue: __S(1100, __c34, 12), review_comments: __S(1100, __c34, 12), review_comment: __S(1100, __c34, 12), self: __S(1100, __c34, 12), }), ).annotate({ identifier: "PullRequestSimpleLinks" }); case 14: return S.suspend(() => S.Struct({ enabled_by: __S(576, __c18, 0), merge_method: S.String, commit_title: S.String, commit_message: S.String, }), ).annotate({ identifier: "AutoMerge" }); case 15: return S.suspend(() => S.Struct({ ref: S.String, sha: S.String, }), ).annotate({ identifier: "PullRequestStackBase" }); case 16: return S.suspend(() => S.Struct({ base: __S(1103, __c34, 15), size: S.optional(S.Number), position: S.optional(S.Number), id: S.optional(S.Number), number: S.optional(S.Number), }), ).annotate({ identifier: "PullRequestStack" }); case 17: return S.suspend(() => S.Struct({ url: S.String, id: S.Number, node_id: S.String, html_url: S.String, diff_url: S.String, patch_url: S.String, issue_url: S.String, commits_url: S.String, review_comments_url: S.String, review_comment_url: S.String, comments_url: S.String, statuses_url: S.String, number: S.Number, state: S.String, locked: S.Boolean, title: S.String, user: S.NullOr(__S(576, __c18, 0)), body: S.NullOr(S.String), labels: __S(1089, __c34, 1), milestone: S.NullOr(__S(1090, __c34, 2)), active_lock_reason: S.optional(S.NullOr(S.String)), created_at: S.String, updated_at: S.String, closed_at: S.NullOr(S.String), merged_at: S.NullOr(S.String), merge_commit_sha: S.NullOr(S.String), assignee: S.NullOr(__S(576, __c18, 0)), assignees: S.optional(__S(1059, __c33, 3)), requested_reviewers: S.optional(__S(1059, __c33, 3)), requested_teams: S.optional(__S(1094, __c34, 6)), head: __S(1099, __c34, 11), base: __S(1099, __c34, 11), _links: __S(1101, __c34, 13), author_association: S.String, auto_merge: S.NullOr(__S(1102, __c34, 14)), stack: S.optional(S.NullOr(__S(1104, __c34, 16))), draft: S.optional(S.Boolean), }), ).annotate({ identifier: "PullRequestSimple" }); case 18: return S.Array(__S(1105, __c34, 17)); case 19: return S.suspend(() => S.Struct({ number: S.Number, created_at: S.String, updated_at: S.optional(S.String), url: S.String, html_url: S.String, instances_url: S.String, state: S.NullOr(S.String), fixed_at: S.optional(S.NullOr(S.String)), dismissed_by: S.NullOr(__S(576, __c18, 0)), dismissed_at: S.NullOr(S.String), dismissed_reason: S.NullOr(S.String), dismissed_comment: S.optional(S.NullOr(S.String)), rule: __S(1056, __c33, 0), tool: __S(1120, __c35, 0), most_recent_instance: __S(1058, __c33, 2), dismissal_approved_by: S.optional(S.NullOr(__S(576, __c18, 0))), assignees: S.optional(__S(1059, __c33, 3)), linked_pull_requests: S.optional(__S(1106, __c34, 18)), }), ).annotate({ identifier: "CodeScanningAlert" }); } } function __c35(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ name: S.optional(S.String), version: S.optional(S.NullOr(S.String)), guid: S.optional(S.NullOr(S.String)), }), ).annotate({ identifier: "CodeScanningAnalysisTool" }); } } function __c36(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ owner: S.String.pipe(T.Label()), repo: S.String.pipe(T.Label()), analysis_id: S.Number.pipe(T.Label()), }).pipe( T.Http({ method: "GET", uri: "/repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}", code: 200, }), ), ).annotate({ identifier: "GetAnalysisRequest" }); } } function __c37(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ ref: S.String, commit_sha: S.String, analysis_key: S.String, environment: S.String, category: S.optional(S.String), error: S.String, created_at: S.String, results_count: S.Number, rules_count: S.Number, id: S.Number, url: S.String, sarif_id: S.String, tool: __S(1120, __c35, 0), deletable: S.Boolean, warning: S.String, }), ).annotate({ identifier: "CodeScanningAnalysis" }); } } function __c38(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ owner: S.String.pipe(T.Label()), repo: S.String.pipe(T.Label()), alert_number: S.Number.pipe(T.Label()), }).pipe( T.Http({ method: "GET", uri: "/repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix", code: 200, }), ), ).annotate({ identifier: "GetAutofixRequest" }); } } // Schema table: entry i is schema j of builder f, made on first reach. function __S(i: number, f: (j: number) => unknown, j: number): any { return (__s[i] ??= __L.at(f, j)); }