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 { 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: "SecurityAdvisories", labels: "github", propagate: "w3c", } as const; export interface CreateForkRequest { /** 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 GHSA (GitHub Security Advisory) identifier of the advisory. */ ghsa_id: string; } export interface CreateForkResponse {} /** The package's language or package management ecosystem. */ export type SecurityAdvisoryEcosystems = | "rubygems" | "npm" | "pip" | "maven" | "nuget" | "composer" | "go" | "rust" | "erlang" | "actions" | "pub" | "other" | "swift"; /** The name of the package affected by the vulnerability. */ export interface CreatePrivateVulnerabilityReportRequestVulnerabilitiesItemPackage { ecosystem: SecurityAdvisoryEcosystems | (string & {}); /** The unique package name within its ecosystem. */ name?: string | null | undefined; } /** The functions in the package that are affected. */ export type CreatePrivateVulnerabilityReportRequestVulnerabilitiesItemVulnerableFunctionsList = Array; export interface CreatePrivateVulnerabilityReportRequestVulnerabilitiesItem { /** The name of the package affected by the vulnerability. */ package: CreatePrivateVulnerabilityReportRequestVulnerabilitiesItemPackage; /** The range of the package versions affected by the vulnerability. */ vulnerable_version_range?: string | null | undefined; /** The package version(s) that resolve the vulnerability. */ patched_versions?: string | null | undefined; /** The functions in the package that are affected. */ vulnerable_functions?: | CreatePrivateVulnerabilityReportRequestVulnerabilitiesItemVulnerableFunctionsList | null | undefined; } /** An array of products affected by the vulnerability detailed in a repository security advisory. */ export type CreatePrivateVulnerabilityReportRequestVulnerabilitiesList = Array; /** A list of Common Weakness Enumeration (CWE) IDs. */ export type CreatePrivateVulnerabilityReportRequestCweIdsList = Array; /** The severity of the advisory. You must choose between setting this field or `cvss_vector_string`. */ export type CreatePrivateVulnerabilityReportRequestSeverity = | "critical" | "high" | "medium" | "low"; export interface CreatePrivateVulnerabilityReportRequest { /** 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; /** A short summary of the advisory. */ summary: string; /** A detailed description of what the advisory impacts. */ description: string; /** An array of products affected by the vulnerability detailed in a repository security advisory. */ vulnerabilities?: CreatePrivateVulnerabilityReportRequestVulnerabilitiesList | null | undefined; /** A list of Common Weakness Enumeration (CWE) IDs. */ cwe_ids?: CreatePrivateVulnerabilityReportRequestCweIdsList | null | undefined; /** The severity of the advisory. You must choose between setting this field or `cvss_vector_string`. */ severity?: CreatePrivateVulnerabilityReportRequestSeverity | (string & {}) | null | undefined; /** The CVSS vector that calculates the severity of the advisory. You must choose between setting this field or `severity`. */ cvss_vector_string?: string | null | undefined; /** Whether to create a temporary private fork of the repository to collaborate on a fix. The fork is created only if you are permitted to create one; otherwise, this parameter is ignored and the report is still created. */ start_private_fork?: boolean | undefined; } /** The severity of the advisory. */ export type RepositoryAdvisorySeverity = "critical" | "high" | "medium" | "low"; /** 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; } /** The type of identifier. */ export type RepositoryAdvisoryIdentifiersItemType = "CVE" | "GHSA"; export interface RepositoryAdvisoryIdentifiersItem { /** The type of identifier. */ type: RepositoryAdvisoryIdentifiersItemType; /** The identifier value. */ value: string; } export type RepositoryAdvisoryIdentifiersList = Array; /** The state of the advisory. */ export type RepositoryAdvisoryState = "published" | "closed" | "withdrawn" | "draft" | "triage"; export interface RepositoryAdvisorySubmission { /** Whether a private vulnerability report was accepted by the repository's administrators. */ accepted: boolean; } /** The name of the package affected by the vulnerability. */ export interface RepositoryAdvisoryVulnerabilityPackage { ecosystem: SecurityAdvisoryEcosystems; /** The unique package name within its ecosystem. */ name: string | null; } /** The functions in the package that are affected. */ export type RepositoryAdvisoryVulnerabilityVulnerableFunctionsList = Array; /** A product affected by the vulnerability detailed in a repository security advisory. */ export interface RepositoryAdvisoryVulnerability { /** The name of the package affected by the vulnerability. */ package: RepositoryAdvisoryVulnerabilityPackage | null; /** The range of the package versions affected by the vulnerability. */ vulnerable_version_range: string | null; /** The package version(s) that resolve the vulnerability. */ patched_versions: string | null; /** The functions in the package that are affected. */ vulnerable_functions: RepositoryAdvisoryVulnerabilityVulnerableFunctionsList | null; } export type RepositoryAdvisoryVulnerabilitiesList = Array; export interface RepositoryAdvisoryCvss { /** The CVSS vector. */ vector_string: string | null; /** The CVSS score. */ score: number | null; } export interface CvssSeveritiesCvssV3 { /** The CVSS 3 vector string. */ vector_string: string | null; /** The CVSS 3 score. */ score: number | null; } export interface CvssSeveritiesCvssV4 { /** The CVSS 4 vector string. */ vector_string: string | null; /** The CVSS 4 score. */ score: number | null; } export interface CvssSeverities { cvss_v3?: CvssSeveritiesCvssV3 | null | undefined; cvss_v4?: CvssSeveritiesCvssV4 | null | undefined; } export interface RepositoryAdvisoryCwesItem { /** The Common Weakness Enumeration (CWE) identifier. */ cwe_id: string; /** The name of the CWE. */ name: string; } export type RepositoryAdvisoryCwesList = Array; /** A list of only the CWE IDs. */ export type RepositoryAdvisoryCweIdsList = Array; /** The type of credit the user is receiving. */ export type SecurityAdvisoryCreditTypes = | "analyst" | "finder" | "reporter" | "coordinator" | "remediation_developer" | "remediation_reviewer" | "remediation_verifier" | "tool" | "sponsor" | "other"; export interface RepositoryAdvisoryCreditsItem { /** The username of the user credited. */ login?: string | undefined; type?: SecurityAdvisoryCreditTypes | undefined; } export type RepositoryAdvisoryCreditsList = Array; /** The state of the user's acceptance of the credit. */ export type RepositoryAdvisoryCreditState = "accepted" | "declined" | "pending"; /** A credit given to a user for a repository security advisory. */ export interface RepositoryAdvisoryCredit { user: SimpleUser; type: SecurityAdvisoryCreditTypes; /** The state of the user's acceptance of the credit. */ state: RepositoryAdvisoryCreditState; } export type RepositoryAdvisoryCreditsDetailedList = Array; /** A list of users that collaborate on the advisory. */ export type RepositoryAdvisoryCollaboratingUsersList = 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; } /** A list of teams that collaborate on the advisory. */ export type RepositoryAdvisoryCollaboratingTeamsList = Array; /** 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; } /** A repository security advisory. */ export interface RepositoryAdvisory { /** The GitHub Security Advisory ID. */ ghsa_id: string; /** The Common Vulnerabilities and Exposures (CVE) ID. */ cve_id: string | null; /** The API URL for the advisory. */ url: string; /** The URL for the advisory. */ html_url: string; /** A short summary of the advisory. */ summary: string; /** A detailed description of what the advisory entails. */ description: string | null; /** The severity of the advisory. */ severity: RepositoryAdvisorySeverity | null; /** The author of the advisory. */ author: SimpleUser | null; /** The publisher of the advisory. */ publisher: SimpleUser | null; identifiers: RepositoryAdvisoryIdentifiersList; /** The state of the advisory. */ state: RepositoryAdvisoryState; /** The date and time of when the advisory was created, in ISO 8601 format. */ created_at: string | null; /** The date and time of when the advisory was last updated, in ISO 8601 format. */ updated_at: string | null; /** The date and time of when the advisory was published, in ISO 8601 format. */ published_at: string | null; /** The date and time of when the advisory was closed, in ISO 8601 format. */ closed_at: string | null; /** The date and time of when the advisory was withdrawn, in ISO 8601 format. */ withdrawn_at: string | null; submission: RepositoryAdvisorySubmission | null; vulnerabilities: RepositoryAdvisoryVulnerabilitiesList | null; cvss: RepositoryAdvisoryCvss | null; cvss_severities?: CvssSeverities | null | undefined; cwes: RepositoryAdvisoryCwesList | null; /** A list of only the CWE IDs. */ cwe_ids: RepositoryAdvisoryCweIdsList | null; credits: RepositoryAdvisoryCreditsList | null; credits_detailed: RepositoryAdvisoryCreditsDetailedList | null; /** A list of users that collaborate on the advisory. */ collaborating_users: RepositoryAdvisoryCollaboratingUsersList | null; /** A list of teams that collaborate on the advisory. */ collaborating_teams: RepositoryAdvisoryCollaboratingTeamsList | null; /** A temporary private fork of the advisory's repository for collaborating on a fix. */ private_fork: SimpleRepository | null; } /** The name of the package affected by the vulnerability. */ export type CreateRepositoryAdvisoryRequestVulnerabilitiesItemPackage = CreatePrivateVulnerabilityReportRequestVulnerabilitiesItemPackage; /** The functions in the package that are affected. */ export type CreateRepositoryAdvisoryRequestVulnerabilitiesItemVulnerableFunctionsList = Array; export interface CreateRepositoryAdvisoryRequestVulnerabilitiesItem { /** The name of the package affected by the vulnerability. */ package: CreatePrivateVulnerabilityReportRequestVulnerabilitiesItemPackage; /** The range of the package versions affected by the vulnerability. */ vulnerable_version_range?: string | null | undefined; /** The package version(s) that resolve the vulnerability. */ patched_versions?: string | null | undefined; /** The functions in the package that are affected. */ vulnerable_functions?: | CreateRepositoryAdvisoryRequestVulnerabilitiesItemVulnerableFunctionsList | null | undefined; } /** A product affected by the vulnerability detailed in a repository security advisory. */ export type CreateRepositoryAdvisoryRequestVulnerabilitiesList = Array; /** A list of Common Weakness Enumeration (CWE) IDs. */ export type CreateRepositoryAdvisoryRequestCweIdsList = Array; export interface CreateRepositoryAdvisoryRequestCreditsItem { /** The username of the user credited. */ login: string; type: SecurityAdvisoryCreditTypes | (string & {}); } /** A list of users receiving credit for their participation in the security advisory. */ export type CreateRepositoryAdvisoryRequestCreditsList = Array; /** The severity of the advisory. You must choose between setting this field or `cvss_vector_string`. */ export type CreateRepositoryAdvisoryRequestSeverity = "critical" | "high" | "medium" | "low"; export interface CreateRepositoryAdvisoryRequest { /** 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; /** A short summary of the advisory. */ summary: string; /** A detailed description of what the advisory impacts. */ description: string; /** The Common Vulnerabilities and Exposures (CVE) ID. */ cve_id?: string | null | undefined; /** A product affected by the vulnerability detailed in a repository security advisory. */ vulnerabilities: CreateRepositoryAdvisoryRequestVulnerabilitiesList; /** A list of Common Weakness Enumeration (CWE) IDs. */ cwe_ids?: CreateRepositoryAdvisoryRequestCweIdsList | null | undefined; /** A list of users receiving credit for their participation in the security advisory. */ credits?: CreateRepositoryAdvisoryRequestCreditsList | null | undefined; /** The severity of the advisory. You must choose between setting this field or `cvss_vector_string`. */ severity?: CreateRepositoryAdvisoryRequestSeverity | (string & {}) | null | undefined; /** The CVSS vector that calculates the severity of the advisory. You must choose between setting this field or `severity`. */ cvss_vector_string?: string | null | undefined; /** Whether to create a temporary private fork of the repository to collaborate on a fix. */ start_private_fork?: boolean | undefined; } export interface CreateRepositoryAdvisoryCommentRequest { /** 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 GHSA (GitHub Security Advisory) identifier of the advisory. */ ghsa_id: string; /** The contents of the comment. */ body: string; } /** A GitHub user. */ export type NullableSimpleUser = SimpleUser; /** How the author is associated with the repository. */ export type AuthorAssociation = | "COLLABORATOR" | "CONTRIBUTOR" | "FIRST_TIMER" | "FIRST_TIME_CONTRIBUTOR" | "MANNEQUIN" | "MEMBER" | "NONE" | "OWNER"; /** A comment on a repository security advisory. */ export interface RepositoryAdvisoryComment { /** Unique identifier of the advisory comment. */ id: number; node_id: string; /** API URL for the advisory comment. */ url: string; /** Web URL for the advisory comment. */ html_url: string; /** Contents of the advisory comment. */ body: string; user: SimpleUser | null; created_at: string; updated_at: string; advisory_url: string; author_association: AuthorAssociation; } export interface CreateRepositoryAdvisoryCveRequestRequest { /** 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 GHSA (GitHub Security Advisory) identifier of the advisory. */ ghsa_id: string; } export interface CreateRepositoryAdvisoryCveRequestResponse {} export interface GetGlobalAdvisoryRequest { /** The GHSA (GitHub Security Advisory) identifier of the advisory. */ ghsa_id: string; } /** The type of advisory. */ export type GlobalAdvisoryType = "reviewed" | "unreviewed" | "malware"; /** The severity of the advisory. */ export type GlobalAdvisorySeverity = "critical" | "high" | "medium" | "low" | "unknown"; /** The type of identifier. */ export type GlobalAdvisoryIdentifiersItemType = "CVE" | "GHSA"; export interface GlobalAdvisoryIdentifiersItem { /** The type of identifier. */ type: GlobalAdvisoryIdentifiersItemType; /** The identifier value. */ value: string; } export type GlobalAdvisoryIdentifiersList = Array; export type GlobalAdvisoryReferencesList = Array; /** The name of the package affected by the vulnerability. */ export type VulnerabilityPackage = RepositoryAdvisoryVulnerabilityPackage; /** The functions in the package that are affected by the vulnerability. */ export type VulnerabilityVulnerableFunctionsList = Array; /** A vulnerability describing the product and its affected versions within a GitHub Security Advisory. */ export interface Vulnerability { /** The name of the package affected by the vulnerability. */ package: RepositoryAdvisoryVulnerabilityPackage | null; /** The range of the package versions affected by the vulnerability. */ vulnerable_version_range: string | null; /** The package version that resolves the vulnerability. */ first_patched_version: string | null; /** The functions in the package that are affected by the vulnerability. */ vulnerable_functions: VulnerabilityVulnerableFunctionsList | null; } /** The products and respective version ranges affected by the advisory. */ export type GlobalAdvisoryVulnerabilitiesList = Array; export type GlobalAdvisoryCvss = RepositoryAdvisoryCvss; /** The EPSS scores as calculated by the [Exploit Prediction Scoring System](https://www.first.org/epss). */ export interface SecurityAdvisoryEpss { percentage?: number | undefined; percentile?: number | undefined; } export type GlobalAdvisoryCwesItem = RepositoryAdvisoryCwesItem; export type GlobalAdvisoryCwesList = Array; export interface GlobalAdvisoryCreditsItem { user: SimpleUser; type: SecurityAdvisoryCreditTypes; } /** The users who contributed to the advisory. */ export type GlobalAdvisoryCreditsList = Array; /** A GitHub Security Advisory. */ export interface GlobalAdvisory { /** The GitHub Security Advisory ID. */ ghsa_id: string; /** The Common Vulnerabilities and Exposures (CVE) ID. */ cve_id: string | null; /** The API URL for the advisory. */ url: string; /** The URL for the advisory. */ html_url: string; /** The API URL for the repository advisory. */ repository_advisory_url: string | null; /** A short summary of the advisory. */ summary: string; /** A detailed description of what the advisory entails. */ description: string | null; /** The type of advisory. */ type: GlobalAdvisoryType; /** The severity of the advisory. */ severity: GlobalAdvisorySeverity; /** The URL of the advisory's source code. */ source_code_location: string | null; identifiers: GlobalAdvisoryIdentifiersList | null; references: GlobalAdvisoryReferencesList | null; /** The date and time of when the advisory was published, in ISO 8601 format. */ published_at: string; /** The date and time of when the advisory was last updated, in ISO 8601 format. */ updated_at: string; /** The date and time of when the advisory was reviewed by GitHub, in ISO 8601 format. */ github_reviewed_at: string | null; /** The date and time when the advisory was published in the National Vulnerability Database, in ISO 8601 format. This field is only populated when the advisory is imported from the National Vulnerability Database. */ nvd_published_at: string | null; /** The date and time of when the advisory was withdrawn, in ISO 8601 format. */ withdrawn_at: string | null; /** The products and respective version ranges affected by the advisory. */ vulnerabilities: GlobalAdvisoryVulnerabilitiesList | null; cvss: RepositoryAdvisoryCvss | null; cvss_severities?: CvssSeverities | null | undefined; epss?: SecurityAdvisoryEpss | null | undefined; cwes: GlobalAdvisoryCwesList | null; /** The users who contributed to the advisory. */ credits: GlobalAdvisoryCreditsList | null; } export interface GetRepositoryAdvisoryRequest { /** 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 GHSA (GitHub Security Advisory) identifier of the advisory. */ ghsa_id: string; } export interface GetRepositoryAdvisoryCommentRequest { /** 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 GHSA (GitHub Security Advisory) identifier of the advisory. */ ghsa_id: string; /** The unique identifier of the comment. */ comment_id: number; } export type ListGlobalAdvisoriesRequestType = "reviewed" | "malware" | "unreviewed"; export type ListGlobalAdvisoriesRequestSeverity = | "unknown" | "low" | "medium" | "high" | "critical"; export type ListGlobalAdvisoriesRequestCwesCase1List = Array; export type ListGlobalAdvisoriesRequestCwes = string | ListGlobalAdvisoriesRequestCwesCase1List; export type ListGlobalAdvisoriesRequestAffectsCase1List = Array; export type ListGlobalAdvisoriesRequestAffects = | string | ListGlobalAdvisoriesRequestAffectsCase1List; export type ListGlobalAdvisoriesRequestDirection = "asc" | "desc"; export type ListGlobalAdvisoriesRequestSort = | "updated" | "published" | "epss_percentage" | "epss_percentile"; export interface ListGlobalAdvisoriesRequest { /** If specified, only advisories with this GHSA (GitHub Security Advisory) identifier will be returned. */ ghsa_id?: string | undefined; /** If specified, only advisories of this type will be returned. By default, a request with no other parameters defined will only return reviewed advisories that are not malware. */ type?: ListGlobalAdvisoriesRequestType | (string & {}) | undefined; /** If specified, only advisories with this CVE (Common Vulnerabilities and Exposures) identifier will be returned. */ cve_id?: string | undefined; /** If specified, only advisories for these ecosystems will be returned. */ ecosystem?: SecurityAdvisoryEcosystems | (string & {}) | undefined; /** If specified, only advisories with these severities will be returned. */ severity?: ListGlobalAdvisoriesRequestSeverity | (string & {}) | undefined; /** If specified, only advisories with these Common Weakness Enumerations (CWEs) will be returned. Example: `cwes=79,284,22` or `cwes[]=79&cwes[]=284&cwes[]=22` */ cwes?: ListGlobalAdvisoriesRequestCwes | undefined; /** Whether to only return advisories that have been withdrawn. */ is_withdrawn?: boolean | undefined; /** If specified, only return advisories that affect any of `package` or `package@version`. A maximum of 1000 packages can be specified. If the query parameter causes the URL to exceed the maximum URL length supported by your client, you must specify fewer packages. Example: `affects=package1,package2@1.0.0,package3@2.0.0` or `affects[]=package1&affects[]=package2@1.0.0` */ affects?: ListGlobalAdvisoriesRequestAffects | undefined; /** If specified, only return advisories that were published on a date or date range. For more information on the syntax of the date range, see "[Understanding the search syntax](https://docs.github.com/search-github/getting-started-with-searching-on-github/understanding-the-search-syntax#query-for-dates)." */ published?: string | undefined; /** If specified, only return advisories that were updated on a date or date range. For more information on the syntax of the date range, see "[Understanding the search syntax](https://docs.github.com/search-github/getting-started-with-searching-on-github/understanding-the-search-syntax#query-for-dates)." */ updated?: string | undefined; /** If specified, only show advisories that were updated or published on a date or date range. For more information on the syntax of the date range, see "[Understanding the search syntax](https://docs.github.com/search-github/getting-started-with-searching-on-github/understanding-the-search-syntax#query-for-dates)." */ modified?: string | undefined; /** If specified, only return advisories that have an EPSS percentage score that matches the provided value. The EPSS percentage represents the likelihood of a CVE being exploited. */ epss_percentage?: string | undefined; /** If specified, only return advisories that have an EPSS percentile score that matches the provided value. The EPSS percentile represents the relative rank of the CVE's likelihood of being exploited compared to other CVEs. */ epss_percentile?: 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 direction to sort the results by. */ direction?: ListGlobalAdvisoriesRequestDirection | (string & {}) | 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 property to sort the results by. */ sort?: ListGlobalAdvisoriesRequestSort | (string & {}) | undefined; } export type ListGlobalAdvisoriesResponseBodyList = Array; export type ListGlobalAdvisoriesResponse = ListGlobalAdvisoriesResponseBodyList; export type ListOrgRepositoryAdvisoriesRequestDirection = "asc" | "desc"; export type ListOrgRepositoryAdvisoriesRequestSort = "created" | "updated" | "published"; export type ListOrgRepositoryAdvisoriesRequestState = "triage" | "draft" | "published" | "closed"; export interface ListOrgRepositoryAdvisoriesRequest { /** The organization name. The name is not case sensitive. */ org: string; /** The direction to sort the results by. */ direction?: ListOrgRepositoryAdvisoriesRequestDirection | (string & {}) | undefined; /** The property to sort the results by. */ sort?: ListOrgRepositoryAdvisoriesRequestSort | (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 number of advisories to return per page. 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; /** Filter by the state of the repository advisories. Only advisories of this state will be returned. */ state?: ListOrgRepositoryAdvisoriesRequestState | (string & {}) | undefined; } export type ListOrgRepositoryAdvisoriesResponseBodyList = Array; export type ListOrgRepositoryAdvisoriesResponse = ListOrgRepositoryAdvisoriesResponseBodyList; export type ListRepositoryAdvisoriesRequestDirection = "asc" | "desc"; export type ListRepositoryAdvisoriesRequestSort = "created" | "updated" | "published"; export type ListRepositoryAdvisoriesRequestState = "triage" | "draft" | "published" | "closed"; export interface ListRepositoryAdvisoriesRequest { /** 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 direction to sort the results by. */ direction?: ListRepositoryAdvisoriesRequestDirection | (string & {}) | undefined; /** The property to sort the results by. */ sort?: ListRepositoryAdvisoriesRequestSort | (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 number of advisories to return per page. 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; /** Filter by state of the repository advisories. Only advisories of this state will be returned. */ state?: ListRepositoryAdvisoriesRequestState | (string & {}) | undefined; } export type ListRepositoryAdvisoriesResponseBodyList = Array; export type ListRepositoryAdvisoriesResponse = ListRepositoryAdvisoriesResponseBodyList; export interface ListRepositoryAdvisoryCommentsRequest { /** 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 GHSA (GitHub Security Advisory) identifier of the advisory. */ ghsa_id: string; /** Only show results that were last updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. */ since?: string | 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 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; } export type ListRepositoryAdvisoryCommentsResponseBodyList = Array; export type ListRepositoryAdvisoryCommentsResponse = ListRepositoryAdvisoryCommentsResponseBodyList; /** The name of the package affected by the vulnerability. */ export type UpdateRepositoryAdvisoryRequestVulnerabilitiesItemPackage = CreatePrivateVulnerabilityReportRequestVulnerabilitiesItemPackage; /** The functions in the package that are affected. */ export type UpdateRepositoryAdvisoryRequestVulnerabilitiesItemVulnerableFunctionsList = Array; export interface UpdateRepositoryAdvisoryRequestVulnerabilitiesItem { /** The name of the package affected by the vulnerability. */ package: CreatePrivateVulnerabilityReportRequestVulnerabilitiesItemPackage; /** The range of the package versions affected by the vulnerability. */ vulnerable_version_range?: string | null | undefined; /** The package version(s) that resolve the vulnerability. */ patched_versions?: string | null | undefined; /** The functions in the package that are affected. */ vulnerable_functions?: | UpdateRepositoryAdvisoryRequestVulnerabilitiesItemVulnerableFunctionsList | null | undefined; } /** A product affected by the vulnerability detailed in a repository security advisory. */ export type UpdateRepositoryAdvisoryRequestVulnerabilitiesList = Array; /** A list of Common Weakness Enumeration (CWE) IDs. */ export type UpdateRepositoryAdvisoryRequestCweIdsList = Array; export type UpdateRepositoryAdvisoryRequestCreditsItem = CreateRepositoryAdvisoryRequestCreditsItem; /** A list of users receiving credit for their participation in the security advisory. */ export type UpdateRepositoryAdvisoryRequestCreditsList = Array; /** The severity of the advisory. You must choose between setting this field or `cvss_vector_string`. */ export type UpdateRepositoryAdvisoryRequestSeverity = "critical" | "high" | "medium" | "low"; /** The state of the advisory. */ export type UpdateRepositoryAdvisoryRequestState = "published" | "closed" | "draft"; /** A list of usernames who have been granted write access to the advisory. */ export type UpdateRepositoryAdvisoryRequestCollaboratingUsersList = Array; /** A list of team slugs which have been granted write access to the advisory. */ export type UpdateRepositoryAdvisoryRequestCollaboratingTeamsList = Array; export interface UpdateRepositoryAdvisoryRequest { /** 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 GHSA (GitHub Security Advisory) identifier of the advisory. */ ghsa_id: string; /** A short summary of the advisory. */ summary?: string | undefined; /** A detailed description of what the advisory impacts. */ description?: string | undefined; /** The Common Vulnerabilities and Exposures (CVE) ID. */ cve_id?: string | null | undefined; /** A product affected by the vulnerability detailed in a repository security advisory. */ vulnerabilities?: UpdateRepositoryAdvisoryRequestVulnerabilitiesList | undefined; /** A list of Common Weakness Enumeration (CWE) IDs. */ cwe_ids?: UpdateRepositoryAdvisoryRequestCweIdsList | null | undefined; /** A list of users receiving credit for their participation in the security advisory. */ credits?: UpdateRepositoryAdvisoryRequestCreditsList | null | undefined; /** The severity of the advisory. You must choose between setting this field or `cvss_vector_string`. */ severity?: UpdateRepositoryAdvisoryRequestSeverity | (string & {}) | null | undefined; /** The CVSS vector that calculates the severity of the advisory. You must choose between setting this field or `severity`. */ cvss_vector_string?: string | null | undefined; /** The state of the advisory. */ state?: UpdateRepositoryAdvisoryRequestState | (string & {}) | undefined; /** A list of usernames who have been granted write access to the advisory. */ collaborating_users?: UpdateRepositoryAdvisoryRequestCollaboratingUsersList | null | undefined; /** A list of team slugs which have been granted write access to the advisory. */ collaborating_teams?: UpdateRepositoryAdvisoryRequestCollaboratingTeamsList | null | undefined; } export interface UpdateRepositoryAdvisoryCommentRequest { /** 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 GHSA (GitHub Security Advisory) identifier of the advisory. */ ghsa_id: string; /** The unique identifier of the comment. */ comment_id: number; /** The contents of the comment. */ body: string; } export type CreateForkError = GithubOpError; /** Create a temporary private fork Create a temporary private fork to collaborate on fixing a security vulnerability in a repository. Repository administrators, organization owners, and security managers can create a temporary private fork. The original reporter of a privately reported vulnerability can also create one while they remain a collaborator on the security advisory. Users with a custom repository role that includes permission to create, edit, and manage security advisories can also create a temporary private fork. If they aren't already a collaborator on the security advisory, they are added as one so they can access the fork. > [!NOTE] > Forking a repository happens asynchronously. You may have to wait up to 5 minutes before you can access the fork. */ export const createFork: API.OperationMethod< CreateForkRequest, CreateForkResponse, CreateForkError, GithubOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(0, __c0, 0) as any as S.Schema, output: __S(16, __c1, 0) as any as S.Schema, errors: [], serviceErrors: GithubServiceErrors, protocol: GithubProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "CreateFork", })); export type CreatePrivateVulnerabilityReportError = GithubOpError; /** Privately report a security vulnerability Report a security vulnerability to the maintainers of the repository. See "[Privately reporting a security vulnerability](https://docs.github.com/code-security/security-advisories/guidance-on-reporting-and-writing/privately-reporting-a-security-vulnerability)" for more information about private vulnerability reporting. */ export const createPrivateVulnerabilityReport: API.OperationMethod< CreatePrivateVulnerabilityReportRequest, RepositoryAdvisory, CreatePrivateVulnerabilityReportError, GithubOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(32, __c2, 0) as any as S.Schema, output: __S(109, __c6, 13) as any as S.Schema, errors: [], serviceErrors: GithubServiceErrors, protocol: GithubProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "CreatePrivateVulnerabilityReport", })); export type CreateRepositoryAdvisoryError = GithubOpError; /** Create a repository security advisory Creates a new repository security advisory. In order to create a draft repository security advisory, the authenticated user must be a security manager or administrator of that repository. OAuth app tokens and personal access tokens (classic) need the `repo` or `repository_advisories:write` scope to use this endpoint. */ export const createRepositoryAdvisory: API.OperationMethod< CreateRepositoryAdvisoryRequest, RepositoryAdvisory, CreateRepositoryAdvisoryError, GithubOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(176, __c11, 0) as any as S.Schema, output: __S(109, __c6, 13) as any as S.Schema, errors: [], serviceErrors: GithubServiceErrors, protocol: GithubProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "CreateRepositoryAdvisory", })); export type CreateRepositoryAdvisoryCommentError = GithubOpError; /** Create a repository advisory comment Creates a comment on a repository security advisory. In order to create a comment, the authenticated user must be an advisory collaborator, security manager, or repository administrator. */ export const createRepositoryAdvisoryComment: API.OperationMethod< CreateRepositoryAdvisoryCommentRequest, RepositoryAdvisoryComment, CreateRepositoryAdvisoryCommentError, GithubOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(208, __c13, 0) as any as S.Schema, output: __S(224, __c14, 0) as any as S.Schema, errors: [], serviceErrors: GithubServiceErrors, protocol: GithubProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "CreateRepositoryAdvisoryComment", })); export type CreateRepositoryAdvisoryCveRequestError = GithubOpError; /** Request a CVE for a repository security advisory If you want a CVE identification number for the security vulnerability in your project, and don't already have one, you can request a CVE identification number from GitHub. For more information see "[Requesting a CVE identification number](https://docs.github.com/code-security/security-advisories/repository-security-advisories/publishing-a-repository-security-advisory#requesting-a-cve-identification-number-optional)." You may request a CVE for public repositories, but cannot do so for private repositories. In order to request a CVE for a repository security advisory, the authenticated user must be a security manager or administrator of that repository, or have a custom repository role that includes permission to publish security advisories together with permission to view or manage security advisories. OAuth app tokens and personal access tokens (classic) need the `repo` or `repository_advisories:write` scope to use this endpoint. */ export const createRepositoryAdvisoryCveRequest: API.OperationMethod< CreateRepositoryAdvisoryCveRequestRequest, CreateRepositoryAdvisoryCveRequestResponse, CreateRepositoryAdvisoryCveRequestError, GithubOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(240, __c15, 0) as any as S.Schema, output: __S(16, __c1, 0) as any as S.Schema, errors: [], serviceErrors: GithubServiceErrors, protocol: GithubProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "CreateRepositoryAdvisoryCveRequest", })); export type GetGlobalAdvisoryError = GithubOpError; /** Get a global security advisory Gets a global security advisory using its GitHub Security Advisory (GHSA) identifier. */ export const getGlobalAdvisory: API.OperationMethod< GetGlobalAdvisoryRequest, GlobalAdvisory, GetGlobalAdvisoryError, GithubOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(256, __c16, 0) as any as S.Schema, output: __S(277, __c17, 5) as any as S.Schema, errors: [], serviceErrors: GithubServiceErrors, protocol: GithubProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "GetGlobalAdvisory", })); export type GetRepositoryAdvisoryError = GithubOpError; /** Get a repository security advisory Get a repository security advisory using its GitHub Security Advisory (GHSA) identifier. Anyone can access any published security advisory on a public repository. The authenticated user can access an unpublished security advisory from a repository if they are a security manager or administrator of that repository, or if they are a collaborator on the security advisory. OAuth app tokens and personal access tokens (classic) need the `repo` or `repository_advisories:read` scope to to get a published security advisory in a private repository, or any unpublished security advisory that the authenticated user has access to. */ export const getRepositoryAdvisory: API.OperationMethod< GetRepositoryAdvisoryRequest, RepositoryAdvisory, GetRepositoryAdvisoryError, GithubOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(288, __c18, 0) as any as S.Schema, output: __S(109, __c6, 13) as any as S.Schema, errors: [], serviceErrors: GithubServiceErrors, protocol: GithubProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "GetRepositoryAdvisory", })); export type GetRepositoryAdvisoryCommentError = GithubOpError; /** Get a repository advisory comment Get a comment on a repository security advisory using the comment's ID. Advisory collaborators can view all non-confidential comments on advisories they have access to. Other users can only view comments that are not considered internal. GitHub Apps and fine-grained personal access tokens with the `repository_advisories: read` permission can view all non-confidential comments, including internal comments. OAuth app tokens and personal access tokens (classic) need the `repo` or `repository_advisories:read` scope to get a comment on a security advisory in a private repository, or any unpublished security advisory that the authenticated user has access to. */ export const getRepositoryAdvisoryComment: API.OperationMethod< GetRepositoryAdvisoryCommentRequest, RepositoryAdvisoryComment, GetRepositoryAdvisoryCommentError, GithubOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(304, __c19, 0) as any as S.Schema, output: __S(224, __c14, 0) as any as S.Schema, errors: [], serviceErrors: GithubServiceErrors, protocol: GithubProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "GetRepositoryAdvisoryComment", })); export type ListGlobalAdvisoriesError = GithubOpError; /** List global security advisories Lists all global security advisories that match the specified parameters. If no other parameters are defined, the request will return only GitHub-reviewed advisories that are not malware. By default, all responses will exclude advisories for malware, because malware are not standard vulnerabilities. To list advisories for malware, you must include the `type` parameter in your request, with the value `malware`. For more information about the different types of security advisories, see "[About the GitHub Advisory database](https://docs.github.com/code-security/security-advisories/global-security-advisories/about-the-github-advisory-database#about-types-of-security-advisories)." */ export const listGlobalAdvisories: API.OperationMethod< ListGlobalAdvisoriesRequest, ListGlobalAdvisoriesResponse, ListGlobalAdvisoriesError, GithubOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(320, __c20, 0) as any as S.Schema, output: __S(322, __c20, 2) as any as S.Schema, errors: [], serviceErrors: GithubServiceErrors, protocol: GithubProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "ListGlobalAdvisories", })); export type ListOrgRepositoryAdvisoriesError = GithubOpError; /** List repository security advisories for an organization Lists repository security advisories for an 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 `repo` or `repository_advisories:write` scope to use this endpoint. */ export const listOrgRepositoryAdvisories: API.OperationMethod< ListOrgRepositoryAdvisoriesRequest, ListOrgRepositoryAdvisoriesResponse, ListOrgRepositoryAdvisoriesError, GithubOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(336, __c21, 0) as any as S.Schema, output: __S(353, __c22, 1) as any as S.Schema, errors: [], serviceErrors: GithubServiceErrors, protocol: GithubProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "ListOrgRepositoryAdvisories", })); export type ListRepositoryAdvisoriesError = GithubOpError; /** List repository security advisories Lists security advisories in a repository. The authenticated user can access unpublished security advisories from a repository if they are a security manager or administrator of that repository, or if they are a collaborator on any security advisory. OAuth app tokens and personal access tokens (classic) need the `repo` or `repository_advisories:read` scope to to get a published security advisory in a private repository, or any unpublished security advisory that the authenticated user has access to. */ export const listRepositoryAdvisories: API.OperationMethod< ListRepositoryAdvisoriesRequest, ListRepositoryAdvisoriesResponse, ListRepositoryAdvisoriesError, GithubOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(112, __c7, 0) as any as S.Schema, output: __S(353, __c22, 1) as any as S.Schema, errors: [], serviceErrors: GithubServiceErrors, protocol: GithubProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "ListRepositoryAdvisories", })); export type ListRepositoryAdvisoryCommentsError = GithubOpError; /** List repository security advisory comments Lists comments on a repository security advisory. Accessing internal comments requires write access to the advisory. Callers with read-only access to the advisory receive only eligible post-publication comments. For unpublished advisories, these callers receive an empty list. */ export const listRepositoryAdvisoryComments: API.PaginatedOperationMethod< ListRepositoryAdvisoryCommentsRequest, ListRepositoryAdvisoryCommentsResponse, ListRepositoryAdvisoryCommentsError, GithubOpContext, RepositoryAdvisoryComment > = /*@__PURE__*/ API.makePaginated( () => ({ input: __S(128, __c8, 0) as any as S.Schema, output: __S(130, __c8, 2) as any as S.Schema, errors: [], serviceErrors: GithubServiceErrors, protocol: GithubProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "ListRepositoryAdvisoryComments", pagination: { mode: "link", inputToken: "page", pageSize: "per_page", items: "body" } as const, }), paginateLink, ) as any; export type UpdateRepositoryAdvisoryError = GithubOpError; /** Update a repository security advisory Update a repository security advisory using its GitHub Security Advisory (GHSA) identifier. In order to update any security advisory, the authenticated user must be a security manager or administrator of that repository, or a collaborator on the repository security advisory. Users with a custom repository role that includes permission to create, edit, and manage security advisories can also update it. To change the `state`, the authenticated user must be a security manager or administrator of that repository, or have a custom repository role with the relevant permissions. To accept, close, or reopen, the role must include permission to accept private vulnerability reports and close or reopen security advisories. To publish, the role must include permission to publish security advisories. Both paths also require permission to view or manage security advisories (Read or Write). Users with these custom-role permissions but without permission to create, edit, and manage security advisories can update the `state` field and no other fields. OAuth app tokens and personal access tokens (classic) need the `repo` or `repository_advisories:write` scope to use this endpoint. */ export const updateRepositoryAdvisory: API.OperationMethod< UpdateRepositoryAdvisoryRequest, RepositoryAdvisory, UpdateRepositoryAdvisoryError, GithubOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(144, __c9, 0) as any as S.Schema, output: __S(109, __c6, 13) as any as S.Schema, errors: [], serviceErrors: GithubServiceErrors, protocol: GithubProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "UpdateRepositoryAdvisory", })); export type UpdateRepositoryAdvisoryCommentError = GithubOpError; /** Update a repository advisory comment Update the body of a comment on a repository security advisory using the comment's ID. In order to update a comment, the authenticated user must be the author of the comment, or a security manager or administrator of the repository. OAuth app tokens and personal access tokens (classic) need the `repo` or `repository_advisories:write` scope to use this endpoint. */ export const updateRepositoryAdvisoryComment: API.OperationMethod< UpdateRepositoryAdvisoryCommentRequest, RepositoryAdvisoryComment, UpdateRepositoryAdvisoryCommentError, GithubOpContext > = /*@__PURE__*/ API.make(() => ({ input: __S(160, __c10, 0) as any as S.Schema, output: __S(224, __c14, 0) as any as S.Schema, errors: [], serviceErrors: GithubServiceErrors, protocol: GithubProtocol, retry: Retry.Retry, telemetry: TELEMETRY, span: "UpdateRepositoryAdvisoryComment", })); // 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()), ghsa_id: S.String.pipe(T.Label()), }).pipe( T.Http({ method: "POST", uri: "/repos/{owner}/{repo}/security-advisories/{ghsa_id}/forks", code: 200, }), ), ).annotate({ identifier: "CreateForkRequest" }); } } function __c1(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({})).annotate({ identifier: "CreateForkResponse" }); } } function __c2(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ owner: S.String.pipe(T.Label()), repo: S.String.pipe(T.Label()), summary: S.String, description: S.String, vulnerabilities: S.optional(S.NullOr(__S(50, __c3, 2))), cwe_ids: S.optional(S.NullOr(__S(80, __c5, 0))), severity: S.optional(S.NullOr(S.String)), cvss_vector_string: S.optional(S.NullOr(S.String)), start_private_fork: S.optional(S.Boolean), }).pipe( T.Http({ method: "POST", uri: "/repos/{owner}/{repo}/security-advisories/reports", code: 200, }), ), ).annotate({ identifier: "CreatePrivateVulnerabilityReportRequest" }); } } function __c3(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ ecosystem: S.String, name: S.optional(S.NullOr(S.String)), }), ).annotate({ identifier: "CreatePrivateVulnerabilityReportRequestVulnerabilitiesItemPackage", }); case 1: return S.suspend(() => S.Struct({ package: __S(48, __c3, 0), vulnerable_version_range: S.optional(S.NullOr(S.String)), patched_versions: S.optional(S.NullOr(S.String)), vulnerable_functions: S.optional(S.NullOr(__S(80, __c5, 0))), }), ).annotate({ identifier: "CreatePrivateVulnerabilityReportRequestVulnerabilitiesItem" }); case 2: return S.Array(__S(49, __c3, 1)); } } function __c4(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 __c5(j: number): any { switch (j) { case 0: return S.Array(S.String); case 1: return S.suspend(() => S.Struct({ type: S.String, value: S.String, }), ).annotate({ identifier: "RepositoryAdvisoryIdentifiersItem" }); case 2: return S.Array(__S(81, __c5, 1)); case 3: return S.suspend(() => S.Struct({ ecosystem: S.String, name: S.NullOr(S.String), }), ).annotate({ identifier: "RepositoryAdvisoryVulnerabilityPackage" }); case 4: return S.suspend(() => S.Struct({ vector_string: S.NullOr(S.String), score: S.NullOr(S.Number), }), ).annotate({ identifier: "RepositoryAdvisoryCvss" }); case 5: return S.suspend(() => S.Struct({ cvss_v3: S.optional(S.NullOr(__S(84, __c5, 4))), cvss_v4: S.optional(S.NullOr(__S(84, __c5, 4))), }), ).annotate({ identifier: "CvssSeverities" }); case 6: return S.suspend(() => S.Struct({ cwe_id: S.String, name: S.String, }), ).annotate({ identifier: "RepositoryAdvisoryCwesItem" }); case 7: return S.Array(__S(86, __c5, 6)); } } function __c6(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ accepted: S.Boolean, }), ).annotate({ identifier: "RepositoryAdvisorySubmission" }); case 1: return S.suspend(() => S.Struct({ package: S.NullOr(__S(83, __c5, 3)), vulnerable_version_range: S.NullOr(S.String), patched_versions: S.NullOr(S.String), vulnerable_functions: S.NullOr(__S(80, __c5, 0)), }), ).annotate({ identifier: "RepositoryAdvisoryVulnerability" }); case 2: return S.Array(__S(97, __c6, 1)); case 3: return S.suspend(() => S.Struct({ login: S.optional(S.String), type: S.optional(S.String), }), ).annotate({ identifier: "RepositoryAdvisoryCreditsItem" }); case 4: return S.Array(__S(99, __c6, 3)); case 5: return S.suspend(() => S.Struct({ user: __S(64, __c4, 0), type: S.String, state: S.String, }), ).annotate({ identifier: "RepositoryAdvisoryCredit" }); case 6: return S.Array(__S(101, __c6, 5)); case 7: return S.Array(__S(64, __c4, 0)); case 8: return S.suspend(() => S.Struct({ pull: S.Boolean, triage: S.Boolean, push: S.Boolean, maintain: S.Boolean, admin: S.Boolean, }), ).annotate({ identifier: "TeamPermissions" }); case 9: 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 10: 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(104, __c6, 8)), 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(105, __c6, 9)), }), ).annotate({ identifier: "Team" }); case 11: return S.Array(__S(106, __c6, 10)); case 12: return S.suspend(() => S.Struct({ id: S.Number, node_id: S.String, name: S.String, full_name: S.String, owner: __S(64, __c4, 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" }); case 13: return S.suspend(() => S.Struct({ ghsa_id: S.String, cve_id: S.NullOr(S.String), url: S.String, html_url: S.String, summary: S.String, description: S.NullOr(S.String), severity: S.NullOr(S.String), author: S.NullOr(__S(64, __c4, 0)), publisher: S.NullOr(__S(64, __c4, 0)), identifiers: __S(82, __c5, 2), state: S.String, created_at: S.NullOr(S.String), updated_at: S.NullOr(S.String), published_at: S.NullOr(S.String), closed_at: S.NullOr(S.String), withdrawn_at: S.NullOr(S.String), submission: S.NullOr(__S(96, __c6, 0)), vulnerabilities: S.NullOr(__S(98, __c6, 2)), cvss: S.NullOr(__S(84, __c5, 4)), cvss_severities: S.optional(S.NullOr(__S(85, __c5, 5))), cwes: S.NullOr(__S(87, __c5, 7)), cwe_ids: S.NullOr(__S(80, __c5, 0)), credits: S.NullOr(__S(100, __c6, 4)), credits_detailed: S.NullOr(__S(102, __c6, 6)), collaborating_users: S.NullOr(__S(103, __c6, 7)), collaborating_teams: S.NullOr(__S(107, __c6, 11)), private_fork: S.NullOr(__S(108, __c6, 12)), }), ).annotate({ identifier: "RepositoryAdvisory" }); } } 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()), direction: S.optional(S.String.pipe(T.Query())), sort: S.optional(S.String.pipe(T.Query())), before: S.optional(S.String.pipe(T.Query())), after: S.optional(S.String.pipe(T.Query())), per_page: S.optional(S.Number.pipe(T.Query())), state: S.optional(S.String.pipe(T.Query())), }).pipe( T.Http({ method: "GET", uri: "/repos/{owner}/{repo}/security-advisories", code: 200 }), ), ).annotate({ identifier: "ListRepositoryAdvisoriesRequest" }); } } 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()), ghsa_id: S.String.pipe(T.Label()), since: S.optional(S.String.pipe(T.Query())), per_page: S.optional(S.Number.pipe(T.Query())), page: S.optional(S.Number.pipe(T.Query())), }).pipe( T.Http({ method: "GET", uri: "/repos/{owner}/{repo}/security-advisories/{ghsa_id}/comments", code: 200, }), ), ).annotate({ identifier: "ListRepositoryAdvisoryCommentsRequest" }); case 1: return S.Array(__S(224, __c14, 0)); case 2: return S.suspend(() => __S(129, __c8, 1).pipe(T.RawResponseRoot())).annotate({ identifier: "ListRepositoryAdvisoryCommentsResponse", }); } } 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()), ghsa_id: S.String.pipe(T.Label()), summary: S.optional(S.String), description: S.optional(S.String), cve_id: S.optional(S.NullOr(S.String)), vulnerabilities: S.optional(__S(50, __c3, 2)), cwe_ids: S.optional(S.NullOr(__S(80, __c5, 0))), credits: S.optional(S.NullOr(__S(193, __c12, 1))), severity: S.optional(S.NullOr(S.String)), cvss_vector_string: S.optional(S.NullOr(S.String)), state: S.optional(S.String), collaborating_users: S.optional(S.NullOr(__S(80, __c5, 0))), collaborating_teams: S.optional(S.NullOr(__S(80, __c5, 0))), }).pipe( T.Http({ method: "PATCH", uri: "/repos/{owner}/{repo}/security-advisories/{ghsa_id}", code: 200, }), ), ).annotate({ identifier: "UpdateRepositoryAdvisoryRequest" }); } } 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()), ghsa_id: S.String.pipe(T.Label()), comment_id: S.Number.pipe(T.Label()), body: S.String, }).pipe( T.Http({ method: "PATCH", uri: "/repos/{owner}/{repo}/security-advisories/{ghsa_id}/comments/{comment_id}", code: 200, }), ), ).annotate({ identifier: "UpdateRepositoryAdvisoryCommentRequest" }); } } function __c11(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ owner: S.String.pipe(T.Label()), repo: S.String.pipe(T.Label()), summary: S.String, description: S.String, cve_id: S.optional(S.NullOr(S.String)), vulnerabilities: __S(50, __c3, 2), cwe_ids: S.optional(S.NullOr(__S(80, __c5, 0))), credits: S.optional(S.NullOr(__S(193, __c12, 1))), severity: S.optional(S.NullOr(S.String)), cvss_vector_string: S.optional(S.NullOr(S.String)), start_private_fork: S.optional(S.Boolean), }).pipe( T.Http({ method: "POST", uri: "/repos/{owner}/{repo}/security-advisories", code: 200 }), ), ).annotate({ identifier: "CreateRepositoryAdvisoryRequest" }); } } function __c12(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ login: S.String, type: S.String, }), ).annotate({ identifier: "CreateRepositoryAdvisoryRequestCreditsItem" }); case 1: return S.Array(__S(192, __c12, 0)); } } 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()), ghsa_id: S.String.pipe(T.Label()), body: S.String, }).pipe( T.Http({ method: "POST", uri: "/repos/{owner}/{repo}/security-advisories/{ghsa_id}/comments", code: 200, }), ), ).annotate({ identifier: "CreateRepositoryAdvisoryCommentRequest" }); } } function __c14(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ id: S.Number, node_id: S.String, url: S.String, html_url: S.String, body: S.String, user: S.NullOr(__S(64, __c4, 0)), created_at: S.String, updated_at: S.String, advisory_url: S.String, author_association: S.String, }), ).annotate({ identifier: "RepositoryAdvisoryComment" }); } } 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()), ghsa_id: S.String.pipe(T.Label()), }).pipe( T.Http({ method: "POST", uri: "/repos/{owner}/{repo}/security-advisories/{ghsa_id}/cve", code: 200, }), ), ).annotate({ identifier: "CreateRepositoryAdvisoryCveRequestRequest" }); } } function __c16(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ ghsa_id: S.String.pipe(T.Label()), }).pipe(T.Http({ method: "GET", uri: "/advisories/{ghsa_id}", code: 200 })), ).annotate({ identifier: "GetGlobalAdvisoryRequest" }); } } function __c17(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ package: S.NullOr(__S(83, __c5, 3)), vulnerable_version_range: S.NullOr(S.String), first_patched_version: S.NullOr(S.String), vulnerable_functions: S.NullOr(__S(80, __c5, 0)), }), ).annotate({ identifier: "Vulnerability" }); case 1: return S.Array(__S(272, __c17, 0)); case 2: return S.suspend(() => S.Struct({ percentage: S.optional(S.Number), percentile: S.optional(S.Number), }), ).annotate({ identifier: "SecurityAdvisoryEpss" }); case 3: return S.suspend(() => S.Struct({ user: __S(64, __c4, 0), type: S.String, }), ).annotate({ identifier: "GlobalAdvisoryCreditsItem" }); case 4: return S.Array(__S(275, __c17, 3)); case 5: return S.suspend(() => S.Struct({ ghsa_id: S.String, cve_id: S.NullOr(S.String), url: S.String, html_url: S.String, repository_advisory_url: S.NullOr(S.String), summary: S.String, description: S.NullOr(S.String), type: S.String, severity: S.String, source_code_location: S.NullOr(S.String), identifiers: S.NullOr(__S(82, __c5, 2)), references: S.NullOr(__S(80, __c5, 0)), published_at: S.String, updated_at: S.String, github_reviewed_at: S.NullOr(S.String), nvd_published_at: S.NullOr(S.String), withdrawn_at: S.NullOr(S.String), vulnerabilities: S.NullOr(__S(273, __c17, 1)), cvss: S.NullOr(__S(84, __c5, 4)), cvss_severities: S.optional(S.NullOr(__S(85, __c5, 5))), epss: S.optional(S.NullOr(__S(274, __c17, 2))), cwes: S.NullOr(__S(87, __c5, 7)), credits: S.NullOr(__S(276, __c17, 4)), }), ).annotate({ identifier: "GlobalAdvisory" }); } } function __c18(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ owner: S.String.pipe(T.Label()), repo: S.String.pipe(T.Label()), ghsa_id: S.String.pipe(T.Label()), }).pipe( T.Http({ method: "GET", uri: "/repos/{owner}/{repo}/security-advisories/{ghsa_id}", code: 200, }), ), ).annotate({ identifier: "GetRepositoryAdvisoryRequest" }); } } function __c19(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ owner: S.String.pipe(T.Label()), repo: S.String.pipe(T.Label()), ghsa_id: S.String.pipe(T.Label()), comment_id: S.Number.pipe(T.Label()), }).pipe( T.Http({ method: "GET", uri: "/repos/{owner}/{repo}/security-advisories/{ghsa_id}/comments/{comment_id}", code: 200, }), ), ).annotate({ identifier: "GetRepositoryAdvisoryCommentRequest" }); } } function __c20(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ ghsa_id: S.optional(S.String.pipe(T.Query())), type: S.optional(S.String.pipe(T.Query())), cve_id: S.optional(S.String.pipe(T.Query())), ecosystem: S.optional(S.String.pipe(T.Query())), severity: S.optional(S.String.pipe(T.Query())), cwes: S.optional(S.Unknown.pipe(T.Query())), is_withdrawn: S.optional(S.Boolean.pipe(T.Query())), affects: S.optional(S.Unknown.pipe(T.Query())), published: S.optional(S.String.pipe(T.Query())), updated: S.optional(S.String.pipe(T.Query())), modified: S.optional(S.String.pipe(T.Query())), epss_percentage: S.optional(S.String.pipe(T.Query())), epss_percentile: S.optional(S.String.pipe(T.Query())), before: S.optional(S.String.pipe(T.Query())), after: S.optional(S.String.pipe(T.Query())), direction: S.optional(S.String.pipe(T.Query())), per_page: S.optional(S.Number.pipe(T.Query())), sort: S.optional(S.String.pipe(T.Query())), }).pipe(T.Http({ method: "GET", uri: "/advisories", code: 200 })), ).annotate({ identifier: "ListGlobalAdvisoriesRequest" }); case 1: return S.Array(__S(277, __c17, 5)); case 2: return S.suspend(() => __S(321, __c20, 1).pipe(T.RawResponseRoot())).annotate({ identifier: "ListGlobalAdvisoriesResponse", }); } } function __c21(j: number): any { switch (j) { case 0: return S.suspend(() => S.Struct({ org: S.String.pipe(T.Label()), direction: S.optional(S.String.pipe(T.Query())), sort: S.optional(S.String.pipe(T.Query())), before: S.optional(S.String.pipe(T.Query())), after: S.optional(S.String.pipe(T.Query())), per_page: S.optional(S.Number.pipe(T.Query())), state: S.optional(S.String.pipe(T.Query())), }).pipe(T.Http({ method: "GET", uri: "/orgs/{org}/security-advisories", code: 200 })), ).annotate({ identifier: "ListOrgRepositoryAdvisoriesRequest" }); } } function __c22(j: number): any { switch (j) { case 0: return S.Array(__S(109, __c6, 13)); case 1: return S.suspend(() => __S(352, __c22, 0).pipe(T.RawResponseRoot())).annotate({ identifier: "ListOrgRepositoryAdvisoriesResponse", }); } } // 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)); }