diff --git a/content/authentication/keeping-your-account-and-data-secure/about-authentication-to-github.md b/content/authentication/keeping-your-account-and-data-secure/about-authentication-to-github.md index ff27893c8e82..e746eff0dd94 100644 --- a/content/authentication/keeping-your-account-and-data-secure/about-authentication-to-github.md +++ b/content/authentication/keeping-your-account-and-data-secure/about-authentication-to-github.md @@ -48,7 +48,7 @@ If you need to use multiple accounts on {% data variables.location.product_locat * You'll create a password when you create your account on {% data variables.product.github %}. We recommend that you use a password manager to generate a random and unique password. For more information, see [AUTOTITLE](/authentication/keeping-your-account-and-data-secure/creating-a-strong-password).{% ifversion fpt or ghec %} * If you have not enabled 2FA, {% data variables.product.github %} may ask for additional verification when you first sign in from a new or unrecognized device, such as a new browser profile, a browser where the cookies have been deleted, or a new computer. For more information, see [AUTOTITLE](/authentication/keeping-your-account-and-data-secure/verifying-new-devices-when-signing-in).{% endif %} {% ifversion fpt or ghec %} * **Social login** - * You'll authenticate with one of the supported social login providers (currently only Google is supported) when you create your account on {% data variables.product.github %}. We recommend that you also configure 2FA and add a passkey or a password as an additional account recovery mechanism. + * You'll authenticate with Google or Apple, which are the supported social login providers when you create your account on {% data variables.product.github %}. We recommend that you also configure 2FA and add a passkey or a password as an additional account recovery mechanism. * If you have an existing account created with a password, you can add your social login email to the account. This allows you to use your social login identity as a first-factor (password) replacement when you sign in to {% data variables.product.github %}. * You can unlink your social login identities from your {% data variables.product.github %} email settings page. For more information, see [AUTOTITLE](/account-and-profile/setting-up-and-managing-your-personal-account-on-github/managing-your-personal-account/unlinking-your-email-address-from-a-locked-account) {% endif %} * **Two-factor authentication (2FA)** (recommended) diff --git a/content/authentication/keeping-your-account-and-data-secure/sudo-mode.md b/content/authentication/keeping-your-account-and-data-secure/sudo-mode.md index 7ed1e8cb12c8..c0455a2199c5 100644 --- a/content/authentication/keeping-your-account-and-data-secure/sudo-mode.md +++ b/content/authentication/keeping-your-account-and-data-secure/sudo-mode.md @@ -93,4 +93,4 @@ When prompted to authenticate for sudo mode, type your password, then click **Co Before you can access sudo mode, you must first configure social login. For more information, see [AUTOTITLE](/authentication/keeping-your-account-and-data-secure/about-authentication-to-github). -When prompted to authenticate for sudo mode, type the authentication code sent to your social login email account, then click **Verify**. +When prompted to authenticate for sudo mode, type the authentication code sent to your social login email account, then click **Verify**. If you dont receive the email within few minutes, check your spam folder. diff --git a/content/get-started/start-your-journey/creating-an-account-on-github.md b/content/get-started/start-your-journey/creating-an-account-on-github.md index 88690f8f2a33..ccf6a2915996 100644 --- a/content/get-started/start-your-journey/creating-an-account-on-github.md +++ b/content/get-started/start-your-journey/creating-an-account-on-github.md @@ -22,7 +22,8 @@ topics: To get started with {% data variables.product.prodname_dotcom %}, you'll need to create a free personal account and verify your email address. -You can also authenticate with the supported social login providers (currently only Google is supported) when you create your account on {% data variables.product.prodname_dotcom %}. +You can also authenticate with Google or Apple - which are the supported social login providers when you create your account on {% data variables.product.prodname_dotcom %}. +For iOS users, even if you have enabled the setting "Hide My Email addresses" for your Apple account, using social login will result in creating a new {% data variables.product.github %} account. {% data reusables.accounts.your-personal-account %} diff --git a/content/get-started/using-github/github-mobile.md b/content/get-started/using-github/github-mobile.md index b8b5f41cc74f..3eb81bbd0e0c 100644 --- a/content/get-started/using-github/github-mobile.md +++ b/content/get-started/using-github/github-mobile.md @@ -58,12 +58,7 @@ You can be simultaneously signed into mobile with multiple accounts on {% data v > [!NOTE] > Social login is only available for {% data variables.product.prodname_free_user %} and {% data variables.product.prodname_ghe_cloud %} users -You can sign in to {% data variables.product.prodname_mobile %} using a supported social login provider. Currently, only Google is supported for social login on the {% data variables.product.prodname_mobile %} for Android. To use this option, make sure you originally created your {% data variables.product.github %} account using Google. - -For iOS users, social login with Google is not supported in {% data variables.product.prodname_mobile %}. Follow the steps below to sign in to {% data variables.product.prodname_mobile %} on iOS using an account that was created with Google: -1. Open the native web browser Safari and sign in to your {% data variables.product.github %} account. -1. Authorize {% data variables.product.prodname_mobile %} in your browser when prompted. -1. If you are unable to sign in through your browser, you can set a password or passkey for your {% data variables.product.github %} account on {% data variables.product.github %}. After setting a password or passkey, use your username and password with two-factor authentication, or a passkey, to sign in to {% data variables.product.prodname_mobile %}. +You can sign in to {% data variables.product.prodname_mobile %} using a supported social login provider. Currently, both Google and Apple are supported for social login on the {% data variables.product.prodname_mobile %} for Android and iOS users. To use this option, make sure you originally created your {% data variables.product.github %} account using the respective social login provider - Google or Apple. ### Prerequisites for {% data variables.enterprise.data_residency_site %} accounts diff --git a/package-lock.json b/package-lock.json index 55a412d42f31..b7b29160c194 100644 --- a/package-lock.json +++ b/package-lock.json @@ -176,7 +176,7 @@ "website-scraper": "^5.3.1" }, "engines": { - "node": "^20 || ^22 || ^24" + "node": "^22 || ^24" }, "optionalDependencies": { "esm": "^3.2.25" diff --git a/package.json b/package.json index b08751c59f0d..9381bfb2be42 100644 --- a/package.json +++ b/package.json @@ -323,7 +323,7 @@ "esm": "^3.2.25" }, "engines": { - "node": "^20 || ^22 || ^24" + "node": "^22 || ^24" }, "cacheDirectories": [ "node_modules", diff --git a/src/codeql-cli/README.md b/src/codeql-cli/README.md index 4ff82fd898ed..d30bbb3c8ec1 100644 --- a/src/codeql-cli/README.md +++ b/src/codeql-cli/README.md @@ -8,7 +8,7 @@ The pipeline is used to generate Markdown files that create article pages on the ![A flow chart describing how the automation pipeline for CodeQL CLI generates documentation](./codeql-cli-pipeline-flowchart.png) -A [workflow](.github/workflows/sync-codeql-cli.yml) is used to trigger the automation of the CodeQL CLI documentation. The workflow is manually triggered by a member of the GitHub Docs team approximately every two weeks to align to releases of the CodeQL CLI. The workflow takes an input parameter that specifies the branch to pull the source files from in the semmle-code repo. If the branch input is omitted, the workflow will default to the `main` branch. +A [workflow](https://github.com/github/docs-internal/blob/main/.github/workflows/sync-codeql-cli.yml) is used to trigger the automation of the CodeQL CLI documentation. The workflow is manually triggered by a member of the GitHub Docs team approximately every two weeks to align to releases of the CodeQL CLI. The workflow takes an input parameter that specifies the branch to pull the source files from in the semmle-code repo. If the branch input is omitted, the workflow will default to the `main` branch. The workflow runs the `src/codeql-cli/scripts/sync.js` script, which generates Markdown files under `content/code-security/codeql-cli/codeql-cli-manual`. @@ -45,4 +45,4 @@ Writers can also add an introduction paragraph _above_ the following Markdown co Slack: `#docs-engineering` Repo: `github/docs-engineering` -If you have a question about the CodeQL CLI pipeline, you can ask in the `#docs-engineering` Slack channel. If you notice a problem with the CodeQL CLI pipeline, you can open an issue in the `github/docs-engineering` repository. \ No newline at end of file +If you have a question about the CodeQL CLI pipeline, you can ask in the `#docs-engineering` Slack channel. If you notice a problem with the CodeQL CLI pipeline, you can open an issue in the `github/docs-engineering` repository. diff --git a/src/content-render/index.js b/src/content-render/index.ts similarity index 70% rename from src/content-render/index.js rename to src/content-render/index.ts index 40f279e35721..8cfd7771b05d 100644 --- a/src/content-render/index.js +++ b/src/content-render/index.ts @@ -1,15 +1,26 @@ import { renderLiquid } from './liquid/index' import { renderMarkdown, renderUnified } from './unified/index' import { engine } from './liquid/engine' +import type { Context } from '@/types' -const globalCache = new Map() +interface RenderOptions { + cache?: boolean | ((template: string, context: Context) => string) + filename?: string + textOnly?: boolean +} + +const globalCache = new Map() // parse multiple times because some templates contain more templates. :] -export async function renderContent(template = '', context = {}, options = {}) { +export async function renderContent( + template = '', + context: Context = {} as Context, + options: RenderOptions = {}, +): Promise { // If called with a falsy template, it can't ever become something // when rendered. We can exit early to save some pointless work. if (!template) return template - let cacheKey = null + let cacheKey: string | null = null if (options && options.cache) { if (!context) throw new Error("If setting 'cache' in options, the 'context' must be set too") if (typeof options.cache === 'function') { @@ -21,13 +32,13 @@ export async function renderContent(template = '', context = {}, options = {}) { throw new Error('cache option must return a string if truthy') } if (globalCache.has(cacheKey)) { - return globalCache.get(cacheKey) + return globalCache.get(cacheKey) as string } } try { template = await renderLiquid(template, context) if (context.markdownRequested) { - const md = await renderMarkdown(template, context, options) + const md = await renderMarkdown(template, context) return md } @@ -45,7 +56,7 @@ export async function renderContent(template = '', context = {}, options = {}) { } } -function getDefaultCacheKey(template, context) { +function getDefaultCacheKey(template: string, context: Context): string { return `${template}:${context.currentVersion}:${context.currentLanguage}` } diff --git a/src/content-render/liquid/engine.js b/src/content-render/liquid/engine.js deleted file mode 100644 index e2d5d60c7c9e..000000000000 --- a/src/content-render/liquid/engine.js +++ /dev/null @@ -1,54 +0,0 @@ -import { Liquid } from 'liquidjs' -import GithubSlugger from 'github-slugger' -import IndentedDataReference from './indented-data-reference' -import Data from './data' -import Octicon from './octicon' -import Ifversion from './ifversion' -import { Tool, tags as toolTags } from './tool' -import { Spotlight, tags as spotlightTags } from './spotlight' -import { Prompt } from './prompt' - -export const engine = new Liquid({ - extname: '.html', - dynamicPartials: false, -}) - -engine.registerTag('indented_data_reference', IndentedDataReference) -engine.registerTag('data', Data) -engine.registerTag('octicon', Octicon) -engine.registerTag('ifversion', Ifversion) - -for (const tag of toolTags) { - engine.registerTag(tag, Tool) -} - -for (const tag in spotlightTags) { - engine.registerTag(tag, Spotlight) -} - -engine.registerTag('prompt', Prompt) - -/** - * Like the `size` filter, but specifically for - * getting the number of keys in an object - */ -engine.registerFilter('obj_size', (input) => { - if (!input) return 0 - return Object.keys(input).length -}) - -/** - * Returns the version number of a GHES version string - * ex: enterprise-server@2.22 => 2.22 - */ -engine.registerFilter('version_num', (input) => { - return input.split('@')[1] -}) - -/** - * Convert the input to a slug - */ -engine.registerFilter('slugify', (input) => { - const slugger = new GithubSlugger() - return slugger.slug(input) -}) diff --git a/src/content-render/liquid/engine.ts b/src/content-render/liquid/engine.ts new file mode 100644 index 000000000000..77591e81471b --- /dev/null +++ b/src/content-render/liquid/engine.ts @@ -0,0 +1,66 @@ +import { Liquid } from 'liquidjs' +import GithubSlugger from 'github-slugger' +// Copilot: When converting data.js to TypeScript, remove the 'as any' assertion for anyData below +import Data from './data' +import Octicon from './octicon' +// Copilot: When converting ifversion.js to TypeScript, remove the 'as any' assertion for anyIfversion below +import Ifversion from './ifversion' +// Copilot: When converting tool.js to TypeScript, remove the 'as any' assertion for anyTool below +import { Tool, tags as toolTags } from './tool' +import { Spotlight, tags as spotlightTags } from './spotlight' +import { Prompt } from './prompt' +import IndentedDataReference from './indented-data-reference' + +// Type assertions for .js files without type definitions +// Copilot: Remove these assertions when the corresponding .js files are converted to TypeScript +const anyData = Data as any +const anyIfversion = Ifversion as any +const anyTool = Tool as any +const anySpotlight = Spotlight as any +const anyPrompt = Prompt as any +const anyIndentedDataReference = IndentedDataReference as any + +export const engine = new Liquid({ + extname: '.html', + dynamicPartials: false, +}) + +engine.registerTag('indented_data_reference', anyIndentedDataReference) +engine.registerTag('data', anyData) +engine.registerTag('octicon', Octicon) +engine.registerTag('ifversion', anyIfversion) + +for (const tag of toolTags) { + engine.registerTag(tag, anyTool) +} + +for (const tag in spotlightTags) { + engine.registerTag(tag, anySpotlight) +} + +engine.registerTag('prompt', anyPrompt) + +/** + * Like the `size` filter, but specifically for + * getting the number of keys in an object + */ +engine.registerFilter('obj_size', (input: Record | null | undefined): number => { + if (!input) return 0 + return Object.keys(input).length +}) + +/** + * Returns the version number of a GHES version string + * ex: enterprise-server@2.22 => 2.22 + */ +engine.registerFilter('version_num', (input: string): string => { + return input.split('@')[1] +}) + +/** + * Convert the input to a slug + */ +engine.registerFilter('slugify', (input: string): string => { + const slugger = new GithubSlugger() + return slugger.slug(input) +}) diff --git a/src/content-render/liquid/indented-data-reference.js b/src/content-render/liquid/indented-data-reference.ts similarity index 67% rename from src/content-render/liquid/indented-data-reference.js rename to src/content-render/liquid/indented-data-reference.ts index aa229f8aafc5..7fe2fff3b2c1 100644 --- a/src/content-render/liquid/indented-data-reference.js +++ b/src/content-render/liquid/indented-data-reference.ts @@ -3,6 +3,21 @@ import assert from 'assert' import { THROW_ON_EMPTY, IndentedDataReferenceError } from './error-handling' import { getDataByLanguage } from '@/data-directory/lib/get-data' +// Note: Using 'any' for liquidjs-related types because liquidjs doesn't provide comprehensive TypeScript definitions +interface LiquidTag { + markup: string + liquid: any + parse(tagToken: any): void + render(scope: any): Promise +} + +interface LiquidScope { + environments: { + currentLanguage: string + [key: string]: any + } +} + // This class supports a tag that expects two parameters, a data reference and `spaces=NUMBER`: // // {% indented_data_reference foo.bar spaces=NUMBER %} @@ -13,12 +28,15 @@ import { getDataByLanguage } from '@/data-directory/lib/get-data' // reference is used inside a block element (like a list or nested list) without // affecting the formatting when the reference is used elsewhere via {{ site.data.foo.bar }}. -export default { - parse(tagToken) { +const IndentedDataReference: LiquidTag = { + markup: '', + liquid: null as any, + + parse(tagToken: any): void { this.markup = tagToken.args.trim() }, - async render(scope) { + async render(scope: LiquidScope): Promise { // obfuscate first legit space, remove all other spaces, then restore legit space // this way we can support spaces=NUMBER as well as spaces = NUMBER const input = this.markup @@ -29,12 +47,15 @@ export default { const [dataReference, spaces] = input.split(' ') // if no spaces are specified, default to 2 - const numSpaces = spaces ? spaces.replace(/spaces=/, '') : '2' + const numSpaces: string = spaces ? spaces.replace(/spaces=/, '') : '2' assert(parseInt(numSpaces) || numSpaces === '0', '"spaces=NUMBER" must include a number') // Get the referenced value from the context - const text = getDataByLanguage(dataReference, scope.environments.currentLanguage) + const text: string | undefined = getDataByLanguage( + dataReference, + scope.environments.currentLanguage, + ) if (text === undefined) { if (scope.environments.currentLanguage === 'en') { const message = `Can't find the key 'indented_data_reference ${dataReference}' in the scope.` @@ -47,8 +68,10 @@ export default { } // add spaces to each line - const renderedReferenceWithIndent = text.replace(/^/gm, ' '.repeat(numSpaces)) + const renderedReferenceWithIndent: string = text.replace(/^/gm, ' '.repeat(parseInt(numSpaces))) return this.liquid.parseAndRender(renderedReferenceWithIndent, scope.environments) }, } + +export default IndentedDataReference diff --git a/src/content-render/liquid/octicon.js b/src/content-render/liquid/octicon.ts similarity index 70% rename from src/content-render/liquid/octicon.js rename to src/content-render/liquid/octicon.ts index 51aeaa094f42..3a9e1c72c5eb 100644 --- a/src/content-render/liquid/octicon.js +++ b/src/content-render/liquid/octicon.ts @@ -1,6 +1,22 @@ import { TokenizationError } from 'liquidjs' +// @ts-ignore - @primer/octicons doesn't provide TypeScript declarations import octicons from '@primer/octicons' +// Note: Using 'any' for liquidjs-related types because liquidjs doesn't provide comprehensive TypeScript definitions +interface LiquidTag { + icon: string + options: Record + parse(tagToken: any): void + render(): Promise +} + +interface OcticonsMatch { + groups: { + icon: string + options?: string + } +} + const OptionsSyntax = /([a-zA-Z-]+)="([\w\s-]+)"*/g const Syntax = new RegExp('"(?[a-zA-Z-]+)"(?(?:\\s' + OptionsSyntax.source + ')*)') const SyntaxHelp = 'Syntax Error in tag \'octicon\' - Valid syntax: octicon "" ' @@ -12,9 +28,12 @@ const SyntaxHelp = 'Syntax Error in tag \'octicon\' - Valid syntax: octicon " { // Throw an error if the requested octicon does not exist. if (!Object.prototype.hasOwnProperty.call(octicons, this.icon)) { throw new Error(`Octicon ${this.icon} does not exist`) } - const result = octicons[this.icon].toSVG(this.options) + const result: string = octicons[this.icon].toSVG(this.options) return result }, } + +export default Octicon diff --git a/src/github-apps/lib/index.js b/src/github-apps/lib/index.ts similarity index 55% rename from src/github-apps/lib/index.js rename to src/github-apps/lib/index.ts index 138b9ffd47a9..ed0cfa35a8f9 100644 --- a/src/github-apps/lib/index.js +++ b/src/github-apps/lib/index.ts @@ -5,18 +5,31 @@ import { readCompressedJsonFileFallback } from '@/frame/lib/read-json-file' import { getOpenApiVersion } from '@/versions/lib/all-versions' import { categoriesWithoutSubcategories } from '../../rest/lib/index' +interface AppsConfig { + pages: Record +} + +// Note: Using 'any' for AppsData to maintain compatibility with existing consumers that expect different shapes +type AppsData = any + const ENABLED_APPS_DIR = 'src/github-apps/data' -const githubAppsData = new Map() +const githubAppsData = new Map>() // Initialize the Map with the page type keys listed under `pages` // in the config.json file. -const appsDataConfig = JSON.parse(fs.readFileSync('src/github-apps/lib/config.json', 'utf8')) +const appsDataConfig: AppsConfig = JSON.parse( + fs.readFileSync('src/github-apps/lib/config.json', 'utf8'), +) for (const pageType of Object.keys(appsDataConfig.pages)) { - githubAppsData.set(pageType, new Map()) + githubAppsData.set(pageType, new Map()) } -export async function getAppsData(pageType, docsVersion, apiVersion) { - const pageTypeMap = githubAppsData.get(pageType) +export async function getAppsData( + pageType: string, + docsVersion: string, + apiVersion?: string, +): Promise { + const pageTypeMap = githubAppsData.get(pageType)! const filename = `${pageType}.json` const openApiVersion = getOpenApiVersion(docsVersion) + (apiVersion ? `-${apiVersion}` : '') if (!pageTypeMap.has(openApiVersion)) { @@ -27,26 +40,34 @@ export async function getAppsData(pageType, docsVersion, apiVersion) { pageTypeMap.set(openApiVersion, data) } - return pageTypeMap.get(openApiVersion) + return pageTypeMap.get(openApiVersion)! } -export async function getAppsServerSideProps(context, pageType, { useDisplayTitle = false }) { +export async function getAppsServerSideProps( + context: any, + pageType: string, + { useDisplayTitle = false }: { useDisplayTitle?: boolean }, +): Promise<{ + currentVersion: string + appsItems: AppsData + categoriesWithoutSubcategories: string[] +}> { const { getAutomatedPageMiniTocItems } = await import('@/frame/lib/get-mini-toc-items') const { getAutomatedPageContextFromRequest } = await import( '@/automated-pipelines/components/AutomatedPageContext' ) - const currentVersion = context.query.versionId + const currentVersion: string = context.query.versionId const allVersions = context.req.context.allVersions - const queryApiVersion = context.query.apiVersion - const apiVersion = allVersions[currentVersion].apiVersions.includes(queryApiVersion) + const queryApiVersion: string = context.query.apiVersion + const apiVersion: string = allVersions[currentVersion].apiVersions.includes(queryApiVersion) ? queryApiVersion : allVersions[currentVersion].latestApiVersion - const appsItems = await getAppsData(pageType, currentVersion, apiVersion) + const appsItems: AppsData = await getAppsData(pageType, currentVersion, apiVersion) // Create minitoc const { miniTocItems } = getAutomatedPageContextFromRequest(context.req) - const titles = useDisplayTitle - ? Object.values(appsItems).map((item) => item.displayTitle) + const titles: string[] = useDisplayTitle + ? Object.values(appsItems).map((item: any) => item.displayTitle!) : Object.keys(appsItems) const appMiniToc = await getAutomatedPageMiniTocItems(titles, context) appMiniToc && miniTocItems.push(...appMiniToc) diff --git a/src/github-apps/pages/endpoints-available-for-fine-grained-personal-access-tokens.tsx b/src/github-apps/pages/endpoints-available-for-fine-grained-personal-access-tokens.tsx index 68df0ecd4c64..7ac81235628c 100644 --- a/src/github-apps/pages/endpoints-available-for-fine-grained-personal-access-tokens.tsx +++ b/src/github-apps/pages/endpoints-available-for-fine-grained-personal-access-tokens.tsx @@ -35,7 +35,7 @@ export default function FineGrainedTokenEndpoints({ } export const getServerSideProps: GetServerSideProps = async (context) => { - const { getAppsServerSideProps } = await import('@/github-apps/lib/index.js') + const { getAppsServerSideProps } = await import('@/github-apps/lib/index') const { currentVersion, appsItems, categoriesWithoutSubcategories } = await getAppsServerSideProps(context, 'fine-grained-pat', { useDisplayTitle: false }) diff --git a/src/github-apps/pages/endpoints-available-for-github-app-installation-access-tokens.tsx b/src/github-apps/pages/endpoints-available-for-github-app-installation-access-tokens.tsx index f6abc6c52587..03e9a2c225e6 100644 --- a/src/github-apps/pages/endpoints-available-for-github-app-installation-access-tokens.tsx +++ b/src/github-apps/pages/endpoints-available-for-github-app-installation-access-tokens.tsx @@ -35,7 +35,7 @@ export default function GitHubAppEndpoints({ } export const getServerSideProps: GetServerSideProps = async (context) => { - const { getAppsServerSideProps } = await import('@/github-apps/lib/index.js') + const { getAppsServerSideProps } = await import('@/github-apps/lib/index') const { currentVersion, appsItems, categoriesWithoutSubcategories } = await getAppsServerSideProps(context, 'server-to-server-rest', { useDisplayTitle: false }) diff --git a/src/github-apps/pages/endpoints-available-for-github-app-user-access-tokens.tsx b/src/github-apps/pages/endpoints-available-for-github-app-user-access-tokens.tsx index 6a3e78a06e24..f9ba0047e49c 100644 --- a/src/github-apps/pages/endpoints-available-for-github-app-user-access-tokens.tsx +++ b/src/github-apps/pages/endpoints-available-for-github-app-user-access-tokens.tsx @@ -35,7 +35,7 @@ export default function UserGitHubAppEndpoints({ } export const getServerSideProps: GetServerSideProps = async (context) => { - const { getAppsServerSideProps } = await import('@/github-apps/lib/index.js') + const { getAppsServerSideProps } = await import('@/github-apps/lib/index') const { currentVersion, appsItems, categoriesWithoutSubcategories } = await getAppsServerSideProps(context, 'user-to-server-rest', { useDisplayTitle: false }) diff --git a/src/github-apps/pages/permissions-required-for-fine-grained-personal-access-tokens.tsx b/src/github-apps/pages/permissions-required-for-fine-grained-personal-access-tokens.tsx index 0effe36197ed..8ede643f192c 100644 --- a/src/github-apps/pages/permissions-required-for-fine-grained-personal-access-tokens.tsx +++ b/src/github-apps/pages/permissions-required-for-fine-grained-personal-access-tokens.tsx @@ -36,7 +36,7 @@ export default function FineGrainedPatPermissions({ } export const getServerSideProps: GetServerSideProps = async (context) => { - const { getAppsServerSideProps } = await import('@/github-apps/lib/index.js') + const { getAppsServerSideProps } = await import('@/github-apps/lib/index') const { currentVersion, appsItems, categoriesWithoutSubcategories } = await getAppsServerSideProps(context, 'fine-grained-pat-permissions', { useDisplayTitle: true }) diff --git a/src/github-apps/pages/permissions-required-for-github-apps.tsx b/src/github-apps/pages/permissions-required-for-github-apps.tsx index 9aca0baf673d..13c0c19925ff 100644 --- a/src/github-apps/pages/permissions-required-for-github-apps.tsx +++ b/src/github-apps/pages/permissions-required-for-github-apps.tsx @@ -36,7 +36,7 @@ export default function GitHubAppPermissions({ } export const getServerSideProps: GetServerSideProps = async (context) => { - const { getAppsServerSideProps } = await import('@/github-apps/lib/index.js') + const { getAppsServerSideProps } = await import('@/github-apps/lib/index') const { currentVersion, appsItems, categoriesWithoutSubcategories } = await getAppsServerSideProps(context, 'server-to-server-permissions', { useDisplayTitle: true }) diff --git a/src/github-apps/scripts/permission-list-schema.js b/src/github-apps/scripts/permission-list-schema.ts similarity index 81% rename from src/github-apps/scripts/permission-list-schema.js rename to src/github-apps/scripts/permission-list-schema.ts index af879eb83c10..a30ecd52c2dc 100644 --- a/src/github-apps/scripts/permission-list-schema.js +++ b/src/github-apps/scripts/permission-list-schema.ts @@ -2,7 +2,20 @@ // src/github-apps/data/fine-grained-pat-permissions.json // and src/github-apps/data/server-to-server-permissions.json -const permissionObjects = { +interface SchemaProperty { + type: string + enum?: string[] + description?: string + items?: object +} + +interface Schema { + type: string + required?: string[] + properties: Record +} + +const permissionObjects: Schema = { type: 'object', required: ['access', 'category', 'subcategory', 'slug', 'verb', 'requestPath'], properties: { @@ -32,7 +45,7 @@ const permissionObjects = { }, } -export default { +const schema: Schema = { type: 'object', required: ['title', 'displayTitle', 'permissions'], properties: { @@ -52,3 +65,5 @@ export default { }, }, } + +export default schema diff --git a/src/rest/data/fpt-2022-11-28/schema.json b/src/rest/data/fpt-2022-11-28/schema.json index 722af468f1e9..2df65a42ef8c 100644 --- a/src/rest/data/fpt-2022-11-28/schema.json +++ b/src/rest/data/fpt-2022-11-28/schema.json @@ -6367,13 +6367,13 @@ } ], "previews": [], + "descriptionHTML": "

Removes a repository from the list of selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for enabled_repositories must be configured to selected. For more information, see \"Set GitHub Actions permissions for an organization.\"

\n

OAuth tokens and personal access tokens (classic) need the admin:org scope to use this endpoint.

", "statusCodes": [ { "httpStatusCode": "204", "description": "

No Content

" } - ], - "descriptionHTML": "

Removes a repository from the list of selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for enabled_repositories must be configured to selected. For more information, see \"Set GitHub Actions permissions for an organization.\"

\n

OAuth tokens and personal access tokens (classic) need the admin:org scope to use this endpoint.

" + ] }, { "serverUrl": "https://api.github.com", @@ -6532,13 +6532,13 @@ } ], "previews": [], + "descriptionHTML": "

Sets the actions and reusable workflows that are allowed in an organization. To use this endpoint, the organization permission policy for allowed_actions must be configured to selected. For more information, see \"Set GitHub Actions permissions for an organization.\"

\n

OAuth app tokens and personal access tokens (classic) need the admin:org scope to use this endpoint.

", "statusCodes": [ { "httpStatusCode": "204", "description": "

No Content

" } - ], - "descriptionHTML": "

Sets the actions and reusable workflows that are allowed in an organization. To use this endpoint, the organization permission policy for allowed_actions must be configured to selected. For more information, see \"Set GitHub Actions permissions for an organization.\"

\n

OAuth app tokens and personal access tokens (classic) need the admin:org scope to use this endpoint.

" + ] }, { "serverUrl": "https://api.github.com", @@ -8200,13 +8200,13 @@ } ], "previews": [], + "descriptionHTML": "

Gets the default workflow permissions granted to the GITHUB_TOKEN when running workflows in an organization,\nas well as whether GitHub Actions can submit approving pull request reviews. For more information, see\n\"Setting the permissions of the GITHUB_TOKEN for your organization.\"

\n

OAuth tokens and personal access tokens (classic) need the admin:org scope to use this endpoint.

", "statusCodes": [ { "httpStatusCode": "200", "description": "

OK

" } - ], - "descriptionHTML": "

Gets the default workflow permissions granted to the GITHUB_TOKEN when running workflows in an organization,\nas well as whether GitHub Actions can submit approving pull request reviews. For more information, see\n\"Setting the permissions of the GITHUB_TOKEN for your organization.\"

\n

OAuth tokens and personal access tokens (classic) need the admin:org scope to use this endpoint.

" + ] }, { "serverUrl": "https://api.github.com", @@ -9385,13 +9385,13 @@ } ], "previews": [], + "descriptionHTML": "

Sets the actions and reusable workflows that are allowed in a repository. To use this endpoint, the repository permission policy for allowed_actions must be configured to selected. For more information, see \"Set GitHub Actions permissions for a repository.\"

\n

OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint.

", "statusCodes": [ { "httpStatusCode": "204", "description": "

No Content

" } - ], - "descriptionHTML": "

Sets the actions and reusable workflows that are allowed in a repository. To use this endpoint, the repository permission policy for allowed_actions must be configured to selected. For more information, see \"Set GitHub Actions permissions for a repository.\"

\n

OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint.

" + ] }, { "serverUrl": "https://api.github.com", @@ -10156,13 +10156,13 @@ } ], "previews": [], + "descriptionHTML": "

Deletes a secret in an organization using the secret name.

\n

Authenticated users must have collaborator access to a repository to create, update, or read secrets.

\n

OAuth tokens and personal access tokens (classic) need theadmin:org scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the repo scope to use this endpoint.

", "statusCodes": [ { "httpStatusCode": "204", "description": "

No Content

" } - ], - "descriptionHTML": "

Deletes a secret in an organization using the secret name.

\n

Authenticated users must have collaborator access to a repository to create, update, or read secrets.

\n

OAuth tokens and personal access tokens (classic) need theadmin:org scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the repo scope to use this endpoint.

" + ] }, { "serverUrl": "https://api.github.com", @@ -15374,13 +15374,13 @@ } ], "previews": [], + "descriptionHTML": "

Removes a repository from the list of selected repositories that can access a self-hosted runner group. The runner group must have visibility set to selected. For more information, see \"Create a self-hosted runner group for an organization.\"

\n

OAuth app tokens and personal access tokens (classic) need the admin:org scope to use this endpoint.

", "statusCodes": [ { "httpStatusCode": "204", "description": "

No Content

" } - ], - "descriptionHTML": "

Removes a repository from the list of selected repositories that can access a self-hosted runner group. The runner group must have visibility set to selected. For more information, see \"Create a self-hosted runner group for an organization.\"

\n

OAuth app tokens and personal access tokens (classic) need the admin:org scope to use this endpoint.

" + ] }, { "serverUrl": "https://api.github.com", @@ -19104,6 +19104,7 @@ } ], "previews": [], + "descriptionHTML": "

Adds custom labels to a self-hosted runner configured in an organization.

\n

Authenticated users must have admin access to the organization to use this endpoint.

\n

OAuth tokens and personal access tokens (classic) need the admin:org scope to use this endpoint.

", "statusCodes": [ { "httpStatusCode": "200", @@ -19117,8 +19118,7 @@ "httpStatusCode": "422", "description": "

Validation failed, or the endpoint has been spammed.

" } - ], - "descriptionHTML": "

Adds custom labels to a self-hosted runner configured in an organization.

\n

Authenticated users must have admin access to the organization to use this endpoint.

\n

OAuth tokens and personal access tokens (classic) need the admin:org scope to use this endpoint.

" + ] }, { "serverUrl": "https://api.github.com", @@ -19392,6 +19392,7 @@ } ], "previews": [], + "descriptionHTML": "

Remove all custom labels from a self-hosted runner configured in an\norganization. Returns the remaining read-only labels from the runner.

\n

Authenticated users must have admin access to the organization to use this endpoint.

\n

OAuth app tokens and personal access tokens (classic) need the admin:org scope to use this endpoint. If the repository is private, the repo scope is also required.

", "statusCodes": [ { "httpStatusCode": "200", @@ -19401,8 +19402,7 @@ "httpStatusCode": "404", "description": "

Resource not found

" } - ], - "descriptionHTML": "

Remove all custom labels from a self-hosted runner configured in an\norganization. Returns the remaining read-only labels from the runner.

\n

Authenticated users must have admin access to the organization to use this endpoint.

\n

OAuth app tokens and personal access tokens (classic) need the admin:org scope to use this endpoint. If the repository is private, the repo scope is also required.

" + ] }, { "serverUrl": "https://api.github.com", @@ -25532,13 +25532,13 @@ } ], "previews": [], + "descriptionHTML": "

Lists all repository variables.

\n

Authenticated users must have collaborator access to a repository to create, update, or read variables.

\n

OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint.

", "statusCodes": [ { "httpStatusCode": "200", "description": "

OK

" } - ], - "descriptionHTML": "

Lists all repository variables.

\n

Authenticated users must have collaborator access to a repository to create, update, or read variables.

\n

OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint.

" + ] }, { "serverUrl": "https://api.github.com", @@ -26081,13 +26081,13 @@ } ], "previews": [], + "descriptionHTML": "

Lists all environment variables.

\n

Authenticated users must have collaborator access to a repository to create, update, or read variables.

\n

OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint.

", "statusCodes": [ { "httpStatusCode": "200", "description": "

OK

" } - ], - "descriptionHTML": "

Lists all environment variables.

\n

Authenticated users must have collaborator access to a repository to create, update, or read variables.

\n

OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint.

" + ] }, { "serverUrl": "https://api.github.com", @@ -89435,6 +89435,7 @@ } ], "previews": [], + "descriptionHTML": "

Gets information about whether the authenticated user is subscribed to the repository.

", "statusCodes": [ { "httpStatusCode": "200", @@ -89448,8 +89449,7 @@ "httpStatusCode": "404", "description": "

Not Found if you don't subscribe to the repository

" } - ], - "descriptionHTML": "

Gets information about whether the authenticated user is subscribed to the repository.

" + ] }, { "serverUrl": "https://api.github.com", @@ -111864,6 +111864,7 @@ } ], "previews": [], + "descriptionHTML": "

OAuth or GitHub application owners can revoke a single token for an OAuth application or a GitHub application with an OAuth authorization.

", "statusCodes": [ { "httpStatusCode": "204", @@ -111873,8 +111874,7 @@ "httpStatusCode": "422", "description": "

Validation failed, or the endpoint has been spammed.

" } - ], - "descriptionHTML": "

OAuth or GitHub application owners can revoke a single token for an OAuth application or a GitHub application with an OAuth authorization.

" + ] } ], "webhooks": [ @@ -111957,13 +111957,13 @@ } ], "previews": [], + "descriptionHTML": "

Returns the webhook configuration for a GitHub App. For more information about configuring a webhook for your app, see \"Creating a GitHub App.\"

\n

You must use a JWT to access this endpoint.

", "statusCodes": [ { "httpStatusCode": "200", "description": "

OK

" } - ], - "descriptionHTML": "

Returns the webhook configuration for a GitHub App. For more information about configuring a webhook for your app, see \"Creating a GitHub App.\"

\n

You must use a JWT to access this endpoint.

" + ] }, { "serverUrl": "https://api.github.com", @@ -181393,6 +181393,7 @@ } ], "previews": [], + "descriptionHTML": "

Sets a code security configuration as a default to be applied to new repositories in your enterprise.

\n

This configuration will be applied by default to the matching repository type when created, but only for organizations within the enterprise that do not already have a default code security configuration set.

\n

The authenticated user must be an administrator for the enterprise to use this endpoint.

\n

OAuth app tokens and personal access tokens (classic) need the admin:enterprise scope to use this endpoint.

", "statusCodes": [ { "httpStatusCode": "200", @@ -181406,8 +181407,7 @@ "httpStatusCode": "404", "description": "

Resource not found

" } - ], - "descriptionHTML": "

Sets a code security configuration as a default to be applied to new repositories in your enterprise.

\n

This configuration will be applied by default to the matching repository type when created, but only for organizations within the enterprise that do not already have a default code security configuration set.

\n

The authenticated user must be an administrator for the enterprise to use this endpoint.

\n

OAuth app tokens and personal access tokens (classic) need the admin:enterprise scope to use this endpoint.

" + ] }, { "serverUrl": "https://api.github.com", @@ -196694,6 +196694,7 @@ } ], "previews": [], + "descriptionHTML": "

Creates a codespace owned by the authenticated user for the specified pull request.

\n

OAuth app tokens and personal access tokens (classic) need the codespace scope to use this endpoint.

", "statusCodes": [ { "httpStatusCode": "201", @@ -196719,8 +196720,7 @@ "httpStatusCode": "503", "description": "

Service unavailable

" } - ], - "descriptionHTML": "

Creates a codespace owned by the authenticated user for the specified pull request.

\n

OAuth app tokens and personal access tokens (classic) need the codespace scope to use this endpoint.

" + ] }, { "serverUrl": "https://api.github.com", @@ -206452,6 +206452,7 @@ } ], "previews": [], + "descriptionHTML": "

Gets information about an export of a codespace.

\n

OAuth app tokens and personal access tokens (classic) need the codespace scope to use this endpoint.

", "statusCodes": [ { "httpStatusCode": "200", @@ -206461,8 +206462,7 @@ "httpStatusCode": "404", "description": "

Resource not found

" } - ], - "descriptionHTML": "

Gets information about an export of a codespace.

\n

OAuth app tokens and personal access tokens (classic) need the codespace scope to use this endpoint.

" + ] }, { "serverUrl": "https://api.github.com", @@ -217588,6 +217588,7 @@ } ], "previews": [], + "descriptionHTML": "

Lists all repositories that have been selected when the visibility\nfor repository access to a secret is set to selected.

\n

OAuth app tokens and personal access tokens (classic) need the admin:org scope to use this endpoint.

", "statusCodes": [ { "httpStatusCode": "200", @@ -217597,8 +217598,7 @@ "httpStatusCode": "404", "description": "

Resource not found

" } - ], - "descriptionHTML": "

Lists all repositories that have been selected when the visibility\nfor repository access to a secret is set to selected.

\n

OAuth app tokens and personal access tokens (classic) need the admin:org scope to use this endpoint.

" + ] }, { "serverUrl": "https://api.github.com", @@ -222462,6 +222462,7 @@ } ], "previews": [], + "descriptionHTML": "

Deletes a user's codespace.

\n

OAuth app tokens and personal access tokens (classic) need the admin:org scope to use this endpoint.

", "statusCodes": [ { "httpStatusCode": "202", @@ -222487,8 +222488,7 @@ "httpStatusCode": "500", "description": "

Internal Error

" } - ], - "descriptionHTML": "

Deletes a user's codespace.

\n

OAuth app tokens and personal access tokens (classic) need the admin:org scope to use this endpoint.

" + ] }, { "serverUrl": "https://api.github.com", @@ -224563,13 +224563,13 @@ } ], "previews": [], + "descriptionHTML": "

Gets your public key, which you need to encrypt secrets. You need to\nencrypt a secret before you can create or update secrets.

\n

If the repository is private, OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint.

", "statusCodes": [ { "httpStatusCode": "200", "description": "

OK

" } - ], - "descriptionHTML": "

Gets your public key, which you need to encrypt secrets. You need to\nencrypt a secret before you can create or update secrets.

\n

If the repository is private, OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint.

" + ] }, { "serverUrl": "https://api.github.com", @@ -225310,6 +225310,7 @@ } ], "previews": [], + "descriptionHTML": "

Creates or updates a development environment secret for a user's codespace with an encrypted value. Encrypt your secret using\nLibSodium. For more information, see \"Encrypting secrets for the REST API.\"

\n

The authenticated user must have Codespaces access to use this endpoint.

\n

OAuth app tokens and personal access tokens (classic) need the codespace or codespace:secrets scope to use this endpoint.

", "statusCodes": [ { "httpStatusCode": "201", @@ -225327,8 +225328,7 @@ "httpStatusCode": "422", "description": "

Validation failed, or the endpoint has been spammed.

" } - ], - "descriptionHTML": "

Creates or updates a development environment secret for a user's codespace with an encrypted value. Encrypt your secret using\nLibSodium. For more information, see \"Encrypting secrets for the REST API.\"

\n

The authenticated user must have Codespaces access to use this endpoint.

\n

OAuth app tokens and personal access tokens (classic) need the codespace or codespace:secrets scope to use this endpoint.

" + ] }, { "serverUrl": "https://api.github.com", @@ -243743,13 +243743,13 @@ } ], "previews": [], + "descriptionHTML": "

Lists the commit comments for a specified repository. Comments are ordered by ascending ID.

\n

This endpoint supports the following custom media types. For more information, see \"Media types.\"

\n
    \n
  • application/vnd.github-commitcomment.raw+json: Returns the raw markdown body. Response will include body. This is the default if you do not pass any specific media type.
  • \n
  • application/vnd.github-commitcomment.text+json: Returns a text only representation of the markdown body. Response will include body_text.
  • \n
  • application/vnd.github-commitcomment.html+json: Returns HTML rendered from the body's markdown. Response will include body_html.
  • \n
  • application/vnd.github-commitcomment.full+json: Returns raw, text, and HTML representations. Response will include body, body_text, and body_html.
  • \n
", "statusCodes": [ { "httpStatusCode": "200", "description": "

OK

" } - ], - "descriptionHTML": "

Lists the commit comments for a specified repository. Comments are ordered by ascending ID.

\n

This endpoint supports the following custom media types. For more information, see \"Media types.\"

\n
    \n
  • application/vnd.github-commitcomment.raw+json: Returns the raw markdown body. Response will include body. This is the default if you do not pass any specific media type.
  • \n
  • application/vnd.github-commitcomment.text+json: Returns a text only representation of the markdown body. Response will include body_text.
  • \n
  • application/vnd.github-commitcomment.html+json: Returns HTML rendered from the body's markdown. Response will include body_html.
  • \n
  • application/vnd.github-commitcomment.full+json: Returns raw, text, and HTML representations. Response will include body, body_text, and body_html.
  • \n
" + ] }, { "serverUrl": "https://api.github.com", @@ -259174,6 +259174,7 @@ } ], "previews": [], + "descriptionHTML": "

Sets the default level of repository access Dependabot will have while performing an update. Available values are:

\n
    \n
  • 'public' - Dependabot will only have access to public repositories, unless access is explicitly granted to non-public repositories.
  • \n
  • 'internal' - Dependabot will only have access to public and internal repositories, unless access is explicitly granted to private repositories.
  • \n
\n

Unauthorized users will not see the existence of this endpoint.

\n

This operation supports both server-to-server and user-to-server access.

", "statusCodes": [ { "httpStatusCode": "204", @@ -259187,8 +259188,7 @@ "httpStatusCode": "404", "description": "

Resource not found

" } - ], - "descriptionHTML": "

Sets the default level of repository access Dependabot will have while performing an update. Available values are:

\n
    \n
  • 'public' - Dependabot will only have access to public repositories, unless access is explicitly granted to non-public repositories.
  • \n
  • 'internal' - Dependabot will only have access to public and internal repositories, unless access is explicitly granted to private repositories.
  • \n
\n

Unauthorized users will not see the existence of this endpoint.

\n

This operation supports both server-to-server and user-to-server access.

" + ] } ], "secrets": [ @@ -259340,13 +259340,13 @@ } ], "previews": [], + "descriptionHTML": "

Lists all secrets available in an organization without revealing their\nencrypted values.

\n

OAuth app tokens and personal access tokens (classic) need the admin:org scope to use this endpoint.

", "statusCodes": [ { "httpStatusCode": "200", "description": "

OK

" } - ], - "descriptionHTML": "

Lists all secrets available in an organization without revealing their\nencrypted values.

\n

OAuth app tokens and personal access tokens (classic) need the admin:org scope to use this endpoint.

" + ] }, { "serverUrl": "https://api.github.com", @@ -260773,13 +260773,13 @@ } ], "previews": [], + "descriptionHTML": "

Lists all repositories that have been selected when the visibility\nfor repository access to a secret is set to selected.

\n

OAuth app tokens and personal access tokens (classic) need the admin:org scope to use this endpoint.

", "statusCodes": [ { "httpStatusCode": "200", "description": "

OK

" } - ], - "descriptionHTML": "

Lists all repositories that have been selected when the visibility\nfor repository access to a secret is set to selected.

\n

OAuth app tokens and personal access tokens (classic) need the admin:org scope to use this endpoint.

" + ] }, { "serverUrl": "https://api.github.com", @@ -268167,13 +268167,13 @@ } ], "previews": [], + "descriptionHTML": "

Note

\n

\nTo get information about name patterns that branches must match in order to deploy to this environment, see \"Get a deployment branch policy.\"

\n
\n

Anyone with read access to the repository can use this endpoint.

\n

OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint with a private repository.

", "statusCodes": [ { "httpStatusCode": "200", "description": "

OK

" } - ], - "descriptionHTML": "

Note

\n

\nTo get information about name patterns that branches must match in order to deploy to this environment, see \"Get a deployment branch policy.\"

\n
\n

Anyone with read access to the repository can use this endpoint.

\n

OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint with a private repository.

" + ] }, { "serverUrl": "https://api.github.com", @@ -269337,13 +269337,13 @@ } ], "previews": [], + "descriptionHTML": "

Gets all custom deployment protection rules that are enabled for an environment. Anyone with read access to the repository can use this endpoint. For more information about environments, see \"Using environments for deployment.\"

\n

For more information about the app that is providing this custom deployment rule, see the documentation for the GET /apps/{app_slug} endpoint.

\n

OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint with a private repository.

", "statusCodes": [ { "httpStatusCode": "200", "description": "

List of deployment protection rules

" } - ], - "descriptionHTML": "

Gets all custom deployment protection rules that are enabled for an environment. Anyone with read access to the repository can use this endpoint. For more information about environments, see \"Using environments for deployment.\"

\n

For more information about the app that is providing this custom deployment rule, see the documentation for the GET /apps/{app_slug} endpoint.

\n

OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint with a private repository.

" + ] }, { "serverUrl": "https://api.github.com", @@ -274809,13 +274809,13 @@ } ], "previews": [], + "descriptionHTML": "

To create an enterprise team, the authenticated user must be an owner of the enterprise.

", "statusCodes": [ { "httpStatusCode": "201", "description": "

Created

" } - ], - "descriptionHTML": "

To create an enterprise team, the authenticated user must be an owner of the enterprise.

" + ] }, { "serverUrl": "https://api.github.com", @@ -275233,6 +275233,7 @@ } ], "previews": [], + "descriptionHTML": "

To delete an enterprise team, the authenticated user must be an enterprise owner.

\n

If you are an enterprise owner, deleting an enterprise team will delete all of its IdP mappings as well.

", "statusCodes": [ { "httpStatusCode": "204", @@ -275242,8 +275243,7 @@ "httpStatusCode": "403", "description": "

Forbidden

" } - ], - "descriptionHTML": "

To delete an enterprise team, the authenticated user must be an enterprise owner.

\n

If you are an enterprise owner, deleting an enterprise team will delete all of its IdP mappings as well.

" + ] } ], "enterprise-team-members": [ @@ -276049,13 +276049,13 @@ } ], "previews": [], + "descriptionHTML": "

Remove multiple team members from an enterprise team.

", "statusCodes": [ { "httpStatusCode": "200", "description": "

Successfully removed team members.

" } - ], - "descriptionHTML": "

Remove multiple team members from an enterprise team.

" + ] }, { "serverUrl": "https://api.github.com", @@ -279226,6 +279226,7 @@ } ], "previews": [], + "descriptionHTML": "

List public gists sorted by most recently updated to least recently updated.

\n

Note: With pagination, you can fetch up to 3000 gists. For example, you can fetch 100 pages with 30 gists per page or 30 pages with 100 gists per page.

", "statusCodes": [ { "httpStatusCode": "200", @@ -279243,8 +279244,7 @@ "httpStatusCode": "422", "description": "

Validation failed, or the endpoint has been spammed.

" } - ], - "descriptionHTML": "

List public gists sorted by most recently updated to least recently updated.

\n

Note: With pagination, you can fetch up to 3000 gists. For example, you can fetch 100 pages with 30 gists per page or 30 pages with 100 gists per page.

" + ] }, { "serverUrl": "https://api.github.com", @@ -291260,6 +291260,7 @@ } ], "previews": [], + "descriptionHTML": "", "statusCodes": [ { "httpStatusCode": "204", @@ -291277,8 +291278,7 @@ "httpStatusCode": "404", "description": "

Resource not found

" } - ], - "descriptionHTML": "" + ] } ] }, @@ -294205,6 +294205,7 @@ } ], "previews": [], + "descriptionHTML": "

Get the content of a gitignore template.

\n

This endpoint supports the following custom media types. For more information, see \"Media types.\"

\n
    \n
  • application/vnd.github.raw+json: Returns the raw .gitignore contents.
  • \n
", "statusCodes": [ { "httpStatusCode": "200", @@ -294214,8 +294215,7 @@ "httpStatusCode": "304", "description": "

Not modified

" } - ], - "descriptionHTML": "

Get the content of a gitignore template.

\n

This endpoint supports the following custom media types. For more information, see \"Media types.\"

\n
    \n
  • application/vnd.github.raw+json: Returns the raw .gitignore contents.
  • \n
" + ] } ] }, @@ -325052,6 +325052,7 @@ } ], "previews": [], + "descriptionHTML": "

Checks if a user has permission to be assigned to a specific issue.

\n

If the assignee can be assigned to this issue, a 204 status code with no content is returned.

\n

Otherwise a 404 status code is returned.

", "statusCodes": [ { "httpStatusCode": "204", @@ -325061,8 +325062,7 @@ "httpStatusCode": "404", "description": "

Response if assignee can not be assigned to issue_number

" } - ], - "descriptionHTML": "

Checks if a user has permission to be assigned to a specific issue.

\n

If the assignee can be assigned to this issue, a 204 status code with no content is returned.

\n

Otherwise a 404 status code is returned.

" + ] } ], "comments": [ @@ -326781,6 +326781,7 @@ } ], "previews": [], + "descriptionHTML": "

You can use the REST API to get comments on issues and pull requests. Every pull request is an issue, but not every issue is a pull request.

\n

This endpoint supports the following custom media types. For more information, see \"Media types.\"

\n
    \n
  • application/vnd.github.raw+json: Returns the raw markdown body. Response will include body. This is the default if you do not pass any specific media type.
  • \n
  • application/vnd.github.text+json: Returns a text only representation of the markdown body. Response will include body_text.
  • \n
  • application/vnd.github.html+json: Returns HTML rendered from the body's markdown. Response will include body_html.
  • \n
  • application/vnd.github.full+json: Returns raw, text, and HTML representations. Response will include body, body_text, and body_html.
  • \n
", "statusCodes": [ { "httpStatusCode": "200", @@ -326790,8 +326791,7 @@ "httpStatusCode": "404", "description": "

Resource not found

" } - ], - "descriptionHTML": "

You can use the REST API to get comments on issues and pull requests. Every pull request is an issue, but not every issue is a pull request.

\n

This endpoint supports the following custom media types. For more information, see \"Media types.\"

\n
    \n
  • application/vnd.github.raw+json: Returns the raw markdown body. Response will include body. This is the default if you do not pass any specific media type.
  • \n
  • application/vnd.github.text+json: Returns a text only representation of the markdown body. Response will include body_text.
  • \n
  • application/vnd.github.html+json: Returns HTML rendered from the body's markdown. Response will include body_html.
  • \n
  • application/vnd.github.full+json: Returns raw, text, and HTML representations. Response will include body, body_text, and body_html.
  • \n
" + ] }, { "serverUrl": "https://api.github.com", @@ -327711,13 +327711,13 @@ } ], "previews": [], + "descriptionHTML": "

You can use the REST API to delete comments on issues and pull requests. Every pull request is an issue, but not every issue is a pull request.

", "statusCodes": [ { "httpStatusCode": "204", "description": "

No Content

" } - ], - "descriptionHTML": "

You can use the REST API to delete comments on issues and pull requests. Every pull request is an issue, but not every issue is a pull request.

" + ] }, { "serverUrl": "https://api.github.com", @@ -365027,6 +365027,7 @@ } ], "previews": [], + "descriptionHTML": "

Gets a label using the given name.

", "statusCodes": [ { "httpStatusCode": "200", @@ -365036,8 +365037,7 @@ "httpStatusCode": "404", "description": "

Resource not found

" } - ], - "descriptionHTML": "

Gets a label using the given name.

" + ] }, { "serverUrl": "https://api.github.com", @@ -365966,6 +365966,7 @@ } ], "previews": [], + "descriptionHTML": "

Lists milestones for a repository.

", "statusCodes": [ { "httpStatusCode": "200", @@ -365975,8 +365976,7 @@ "httpStatusCode": "404", "description": "

Resource not found

" } - ], - "descriptionHTML": "

Lists milestones for a repository.

" + ] }, { "serverUrl": "https://api.github.com", @@ -401304,6 +401304,7 @@ } ], "previews": [], + "descriptionHTML": "

This method returns the contents of the repository's license file, if one is detected.

\n

This endpoint supports the following custom media types. For more information, see \"Media types.\"

\n
    \n
  • application/vnd.github.raw+json: Returns the raw contents of the license.
  • \n
  • application/vnd.github.html+json: Returns the license contents in HTML. Markup languages are rendered to HTML using GitHub's open-source Markup library.
  • \n
", "statusCodes": [ { "httpStatusCode": "200", @@ -401313,8 +401314,7 @@ "httpStatusCode": "404", "description": "

Resource not found

" } - ], - "descriptionHTML": "

This method returns the contents of the repository's license file, if one is detected.

\n

This endpoint supports the following custom media types. For more information, see \"Media types.\"

\n
    \n
  • application/vnd.github.raw+json: Returns the raw contents of the license.
  • \n
  • application/vnd.github.html+json: Returns the license contents in HTML. Markup languages are rendered to HTML using GitHub's open-source Markup library.
  • \n
" + ] } ] }, @@ -432790,6 +432790,7 @@ } ], "previews": [], + "descriptionHTML": "

If the authenticated user is an active or pending member of the organization, this endpoint will return the user's membership. If the authenticated user is not affiliated with the organization, a 404 is returned. This endpoint will return a 403 if the request is made by a GitHub App that is blocked by the organization.

", "statusCodes": [ { "httpStatusCode": "200", @@ -432803,8 +432804,7 @@ "httpStatusCode": "404", "description": "

Resource not found

" } - ], - "descriptionHTML": "

If the authenticated user is an active or pending member of the organization, this endpoint will return the user's membership. If the authenticated user is not affiliated with the organization, a 404 is returned. This endpoint will return a 403 if the request is made by a GitHub App that is blocked by the organization.

" + ] }, { "serverUrl": "https://api.github.com", @@ -433601,13 +433601,13 @@ } ], "previews": [], + "descriptionHTML": "

Creates a hosted compute network configuration for an organization.

\n

OAuth app tokens and personal access tokens (classic) need the write:network_configurations scope to use this endpoint.

", "statusCodes": [ { "httpStatusCode": "201", "description": "

Created

" } - ], - "descriptionHTML": "

Creates a hosted compute network configuration for an organization.

\n

OAuth app tokens and personal access tokens (classic) need the write:network_configurations scope to use this endpoint.

" + ] }, { "serverUrl": "https://api.github.com", @@ -435638,6 +435638,7 @@ } ], "previews": [], + "descriptionHTML": "

Lists the teams that are assigned to an organization role. For more information on organization roles, see \"Using organization roles.\"

\n

To use this endpoint, you must be an administrator for the organization.

\n

OAuth app tokens and personal access tokens (classic) need the admin:org scope to use this endpoint.

", "statusCodes": [ { "httpStatusCode": "200", @@ -435651,8 +435652,7 @@ "httpStatusCode": "422", "description": "

Response if the organization roles feature is not enabled or validation failed.

" } - ], - "descriptionHTML": "

Lists the teams that are assigned to an organization role. For more information on organization roles, see \"Using organization roles.\"

\n

To use this endpoint, you must be an administrator for the organization.

\n

OAuth app tokens and personal access tokens (classic) need the admin:org scope to use this endpoint.

" + ] }, { "serverUrl": "https://api.github.com", @@ -454948,13 +454948,13 @@ } ], "previews": [], + "descriptionHTML": "

Gets a specific package in an organization.

\n

OAuth app tokens and personal access tokens (classic) need the read:packages scope to use this endpoint. For more information, see \"About permissions for GitHub Packages.\"

", "statusCodes": [ { "httpStatusCode": "200", "description": "

OK

" } - ], - "descriptionHTML": "

Gets a specific package in an organization.

\n

OAuth app tokens and personal access tokens (classic) need the read:packages scope to use this endpoint. For more information, see \"About permissions for GitHub Packages.\"

" + ] }, { "serverUrl": "https://api.github.com", @@ -547174,13 +547174,13 @@ } ], "previews": [], + "descriptionHTML": "

Lists review comments for all pull requests in a repository. By default,\nreview comments are in ascending order by ID.

\n

This endpoint supports the following custom media types. For more information, see \"Media types.\"

\n
    \n
  • application/vnd.github-commitcomment.raw+json: Returns the raw markdown body. Response will include body. This is the default if you do not pass any specific media type.
  • \n
  • application/vnd.github-commitcomment.text+json: Returns a text only representation of the markdown body. Response will include body_text.
  • \n
  • application/vnd.github-commitcomment.html+json: Returns HTML rendered from the body's markdown. Response will include body_html.
  • \n
  • application/vnd.github-commitcomment.full+json: Returns raw, text, and HTML representations. Response will include body, body_text, and body_html.
  • \n
", "statusCodes": [ { "httpStatusCode": "200", "description": "

OK

" } - ], - "descriptionHTML": "

Lists review comments for all pull requests in a repository. By default,\nreview comments are in ascending order by ID.

\n

This endpoint supports the following custom media types. For more information, see \"Media types.\"

\n
    \n
  • application/vnd.github-commitcomment.raw+json: Returns the raw markdown body. Response will include body. This is the default if you do not pass any specific media type.
  • \n
  • application/vnd.github-commitcomment.text+json: Returns a text only representation of the markdown body. Response will include body_text.
  • \n
  • application/vnd.github-commitcomment.html+json: Returns HTML rendered from the body's markdown. Response will include body_html.
  • \n
  • application/vnd.github-commitcomment.full+json: Returns raw, text, and HTML representations. Response will include body, body_text, and body_html.
  • \n
" + ] }, { "serverUrl": "https://api.github.com", @@ -548475,13 +548475,13 @@ } ], "previews": [], + "descriptionHTML": "

Edits the content of a specified review comment.

\n

This endpoint supports the following custom media types. For more information, see \"Media types.\"

\n
    \n
  • application/vnd.github-commitcomment.raw+json: Returns the raw markdown body. Response will include body. This is the default if you do not pass any specific media type.
  • \n
  • application/vnd.github-commitcomment.text+json: Returns a text only representation of the markdown body. Response will include body_text.
  • \n
  • application/vnd.github-commitcomment.html+json: Returns HTML rendered from the body's markdown. Response will include body_html.
  • \n
  • application/vnd.github-commitcomment.full+json: Returns raw, text, and HTML representations. Response will include body, body_text, and body_html.
  • \n
", "statusCodes": [ { "httpStatusCode": "200", "description": "

OK

" } - ], - "descriptionHTML": "

Edits the content of a specified review comment.

\n

This endpoint supports the following custom media types. For more information, see \"Media types.\"

\n
    \n
  • application/vnd.github-commitcomment.raw+json: Returns the raw markdown body. Response will include body. This is the default if you do not pass any specific media type.
  • \n
  • application/vnd.github-commitcomment.text+json: Returns a text only representation of the markdown body. Response will include body_text.
  • \n
  • application/vnd.github-commitcomment.html+json: Returns HTML rendered from the body's markdown. Response will include body_html.
  • \n
  • application/vnd.github-commitcomment.full+json: Returns raw, text, and HTML representations. Response will include body, body_text, and body_html.
  • \n
" + ] }, { "serverUrl": "https://api.github.com", @@ -570592,13 +570592,13 @@ } ], "previews": [], + "descriptionHTML": "

Note

\n

\nYou can also specify a repository by repository_id using the route DELETE /repositories/:repository_id/issues/:issue_number/reactions/:reaction_id.

\n
\n

Delete a reaction to an issue.

", "statusCodes": [ { "httpStatusCode": "204", "description": "

No Content

" } - ], - "descriptionHTML": "

Note

\n

\nYou can also specify a repository by repository_id using the route DELETE /repositories/:repository_id/issues/:issue_number/reactions/:reaction_id.

\n
\n

Delete a reaction to an issue.

" + ] }, { "serverUrl": "https://api.github.com", @@ -576684,13 +576684,13 @@ } ], "previews": [], + "descriptionHTML": "

View the latest published full release for the repository.

\n

The latest release is the most recent non-prerelease, non-draft release, sorted by the created_at attribute. The created_at attribute is the date of the commit used for the release, and not the date when the release was drafted or published.

", "statusCodes": [ { "httpStatusCode": "200", "description": "

OK

" } - ], - "descriptionHTML": "

View the latest published full release for the repository.

\n

The latest release is the most recent non-prerelease, non-draft release, sorted by the created_at attribute. The created_at attribute is the date of the commit used for the release, and not the date when the release was drafted or published.

" + ] }, { "serverUrl": "https://api.github.com", @@ -577454,6 +577454,7 @@ } ], "previews": [], + "descriptionHTML": "

Get a published release with the specified tag.

", "statusCodes": [ { "httpStatusCode": "200", @@ -577463,8 +577464,7 @@ "httpStatusCode": "404", "description": "

Resource not found

" } - ], - "descriptionHTML": "

Get a published release with the specified tag.

" + ] }, { "serverUrl": "https://api.github.com", @@ -579982,13 +579982,13 @@ } ], "previews": [], + "descriptionHTML": "", "statusCodes": [ { "httpStatusCode": "204", "description": "

No Content

" } - ], - "descriptionHTML": "" + ] }, { "serverUrl": "https://api.github.com", @@ -694794,13 +694794,13 @@ } ], "previews": [], + "descriptionHTML": "

Warning

\n

\nEndpoint closing down notice: This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new List discussion comments endpoint.

\n
\n

List all comments on a team discussion.

\n

OAuth app tokens and personal access tokens (classic) need the read:discussion scope to use this endpoint.

", "statusCodes": [ { "httpStatusCode": "200", "description": "

OK

" } - ], - "descriptionHTML": "

Warning

\n

\nEndpoint closing down notice: This endpoint route is closing down and will be removed from the Teams API. We recommend migrating your existing code to use the new List discussion comments endpoint.

\n
\n

List all comments on a team discussion.

\n

OAuth app tokens and personal access tokens (classic) need the read:discussion scope to use this endpoint.

" + ] }, { "serverUrl": "https://api.github.com", diff --git a/src/rest/data/ghes-3.14-2022-11-28/schema.json b/src/rest/data/ghes-3.14-2022-11-28/schema.json index 0801fc3797bc..091e60b65b91 100644 --- a/src/rest/data/ghes-3.14-2022-11-28/schema.json +++ b/src/rest/data/ghes-3.14-2022-11-28/schema.json @@ -8705,13 +8705,13 @@ } ], "previews": [], - "descriptionHTML": "

Get the public key for an environment, which you need to encrypt environment\nsecrets. You need to encrypt a secret before you can create or update secrets.

\n

Anyone with read access to the repository can use this endpoint.

\n

If the repository is private, OAuth tokens and personal access tokens (classic) need the repo scope to use this endpoint.

", "statusCodes": [ { "httpStatusCode": "200", "description": "

OK

" } - ] + ], + "descriptionHTML": "

Get the public key for an environment, which you need to encrypt environment\nsecrets. You need to encrypt a secret before you can create or update secrets.

\n

Anyone with read access to the repository can use this endpoint.

\n

If the repository is private, OAuth tokens and personal access tokens (classic) need the repo scope to use this endpoint.

" }, { "serverUrl": "http(s)://HOSTNAME/api/v3", @@ -9784,13 +9784,13 @@ } ], "previews": [], - "descriptionHTML": "

Deletes a self-hosted runner group for an enterprise.

\n

OAuth app tokens and personal access tokens (classic) need the manage_runners:enterprise scope to use this endpoint.

", "statusCodes": [ { "httpStatusCode": "204", "description": "

No Content

" } - ] + ], + "descriptionHTML": "

Deletes a self-hosted runner group for an enterprise.

\n

OAuth app tokens and personal access tokens (classic) need the manage_runners:enterprise scope to use this endpoint.

" }, { "serverUrl": "http(s)://HOSTNAME/api/v3", @@ -10665,13 +10665,13 @@ } ], "previews": [], - "descriptionHTML": "

Removes a self-hosted runner from a group configured in an enterprise. The runner is then returned to the default group.

\n

OAuth app tokens and personal access tokens (classic) need the manage_runners:enterprise scope to use this endpoint.

", "statusCodes": [ { "httpStatusCode": "204", "description": "

No Content

" } - ] + ], + "descriptionHTML": "

Removes a self-hosted runner from a group configured in an enterprise. The runner is then returned to the default group.

\n

OAuth app tokens and personal access tokens (classic) need the manage_runners:enterprise scope to use this endpoint.

" }, { "serverUrl": "http(s)://HOSTNAME/api/v3", @@ -27432,13 +27432,13 @@ } ], "previews": [], - "descriptionHTML": "

Gets a specific variable in an environment.

\n

Authenticated users must have collaborator access to a repository to create, update, or read variables.

\n

OAuth tokens and personal access tokens (classic) need the repo scope to use this endpoint.

", "statusCodes": [ { "httpStatusCode": "200", "description": "

OK

" } - ] + ], + "descriptionHTML": "

Gets a specific variable in an environment.

\n

Authenticated users must have collaborator access to a repository to create, update, or read variables.

\n

OAuth tokens and personal access tokens (classic) need the repo scope to use this endpoint.

" }, { "serverUrl": "http(s)://HOSTNAME/api/v3", @@ -38426,13 +38426,13 @@ } ], "previews": [], - "descriptionHTML": "

Approve or reject custom deployment protection rules provided by a GitHub App for a workflow run. For more information, see \"Using environments for deployment.\"

\n

Note

\n

\nGitHub Apps can only review their own custom deployment protection rules. To approve or reject pending deployments that are waiting for review from a specific person or team, see POST /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments.

\n
\n

OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint with a private repository.

", "statusCodes": [ { "httpStatusCode": "204", "description": "

No Content

" } - ] + ], + "descriptionHTML": "

Approve or reject custom deployment protection rules provided by a GitHub App for a workflow run. For more information, see \"Using environments for deployment.\"

\n

Note

\n

\nGitHub Apps can only review their own custom deployment protection rules. To approve or reject pending deployments that are waiting for review from a specific person or team, see POST /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments.

\n
\n

OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint with a private repository.

" }, { "serverUrl": "http(s)://HOSTNAME/api/v3", @@ -39331,13 +39331,13 @@ } ], "previews": [], - "descriptionHTML": "

Get all deployment environments for a workflow run that are waiting for protection rules to pass.

\n

Anyone with read access to the repository can use this endpoint.

\n

If the repository is private, OAuth tokens and personal access tokens (classic) need the repo scope to use this endpoint.

", "statusCodes": [ { "httpStatusCode": "200", "description": "

OK

" } - ] + ], + "descriptionHTML": "

Get all deployment environments for a workflow run that are waiting for protection rules to pass.

\n

Anyone with read access to the repository can use this endpoint.

\n

If the repository is private, OAuth tokens and personal access tokens (classic) need the repo scope to use this endpoint.

" }, { "serverUrl": "http(s)://HOSTNAME/api/v3", @@ -40292,13 +40292,13 @@ } ], "previews": [], - "descriptionHTML": "

Re-runs your workflow run using its id.

\n

OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint.

", "statusCodes": [ { "httpStatusCode": "201", "description": "

Created

" } - ] + ], + "descriptionHTML": "

Re-runs your workflow run using its id.

\n

OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint.

" }, { "serverUrl": "http(s)://HOSTNAME/api/v3", @@ -80875,7 +80875,6 @@ } ], "previews": [], - "descriptionHTML": "

Marks all notifications as \"read\" for the current user. If the number of notifications is too large to complete in one request, you will receive a 202 Accepted status and GitHub Enterprise Server will run an asynchronous process to mark notifications as \"read.\" To check whether any \"unread\" notifications remain, you can use the List notifications for the authenticated user endpoint and pass the query parameter all=false.

", "statusCodes": [ { "httpStatusCode": "202", @@ -80897,7 +80896,8 @@ "httpStatusCode": "403", "description": "

Forbidden

" } - ] + ], + "descriptionHTML": "

Marks all notifications as \"read\" for the current user. If the number of notifications is too large to complete in one request, you will receive a 202 Accepted status and GitHub Enterprise Server will run an asynchronous process to mark notifications as \"read.\" To check whether any \"unread\" notifications remain, you can use the List notifications for the authenticated user endpoint and pass the query parameter all=false.

" }, { "serverUrl": "http(s)://HOSTNAME/api/v3", @@ -83452,13 +83452,13 @@ } ], "previews": [], - "descriptionHTML": "

Lists all notifications for the current user in the specified repository.

", "statusCodes": [ { "httpStatusCode": "200", "description": "

OK

" } - ] + ], + "descriptionHTML": "

Lists all notifications for the current user in the specified repository.

" }, { "serverUrl": "http(s)://HOSTNAME/api/v3", @@ -192013,13 +192013,13 @@ } ], "previews": [], - "descriptionHTML": "

Deletes a secret in a repository using the secret name.

\n

OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint.

", "statusCodes": [ { "httpStatusCode": "204", "description": "

No Content

" } - ] + ], + "descriptionHTML": "

Deletes a secret in a repository using the secret name.

\n

OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint.

" } ] }, @@ -200345,13 +200345,13 @@ } ], "previews": [], - "descriptionHTML": "

Disables a custom deployment protection rule for an environment.

\n

The authenticated user must have admin or owner permissions to the repository to use this endpoint.

\n

OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint.

", "statusCodes": [ { "httpStatusCode": "204", "description": "

No Content

" } - ] + ], + "descriptionHTML": "

Disables a custom deployment protection rule for an environment.

\n

The authenticated user must have admin or owner permissions to the repository to use this endpoint.

\n

OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint.

" } ], "statuses": [ @@ -202069,7 +202069,6 @@ } ], "previews": [], - "descriptionHTML": "

Users with push access can create deployment statuses for a given deployment.

\n

OAuth app tokens and personal access tokens (classic) need the repo_deployment scope to use this endpoint.

", "statusCodes": [ { "httpStatusCode": "201", @@ -202079,7 +202078,8 @@ "httpStatusCode": "422", "description": "

Validation failed, or the endpoint has been spammed.

" } - ] + ], + "descriptionHTML": "

Users with push access can create deployment statuses for a given deployment.

\n

OAuth app tokens and personal access tokens (classic) need the repo_deployment scope to use this endpoint.

" }, { "serverUrl": "http(s)://HOSTNAME/api/v3", @@ -205411,13 +205411,13 @@ } ], "previews": [], - "descriptionHTML": "", "statusCodes": [ { "httpStatusCode": "200", "description": "

OK

" } - ] + ], + "descriptionHTML": "" }, { "serverUrl": "http(s)://HOSTNAME/api/v3", @@ -207224,13 +207224,13 @@ } ], "previews": [], - "descriptionHTML": "", "statusCodes": [ { "httpStatusCode": "200", "description": "

OK

" } - ] + ], + "descriptionHTML": "" }, { "serverUrl": "http(s)://HOSTNAME/api/v3", @@ -209798,7 +209798,6 @@ } ], "previews": [], - "descriptionHTML": "

Check the status of the license that is currently set for the enterprise.

", "statusCodes": [ { "httpStatusCode": "200", @@ -209812,7 +209811,8 @@ "httpStatusCode": "500", "description": "

Internal error

" } - ] + ], + "descriptionHTML": "

Check the status of the license that is currently set for the enterprise.

" }, { "serverUrl": "http(s)://HOSTNAME", @@ -211495,7 +211495,6 @@ } ], "previews": [], - "descriptionHTML": "

Note

\n

\nThe request body for this operation must be submitted as application/x-www-form-urlencoded data. You can submit a parameter value as a string, or you can use a tool such as curl to submit a parameter value as the contents of a text file. For more information, see the curl documentation.

\n
", "statusCodes": [ { "httpStatusCode": "200", @@ -211505,7 +211504,8 @@ "httpStatusCode": "401", "description": "

Unauthorized

" } - ] + ], + "descriptionHTML": "

Note

\n

\nThe request body for this operation must be submitted as application/x-www-form-urlencoded data. You can submit a parameter value as a string, or you can use a tool such as curl to submit a parameter value as the contents of a text file. For more information, see the curl documentation.

\n
" }, { "serverUrl": "http(s)://HOSTNAME", @@ -213920,7 +213920,6 @@ } ], "previews": [], - "descriptionHTML": "

Triggers a new download of the environment tarball from the environment's image_url. When the download is finished, the newly downloaded tarball will overwrite the existing environment.

\n

If a download cannot be triggered, you will receive a 422 Unprocessable Entity response.

\n

The possible error messages are:

\n
    \n
  • Cannot modify or delete the default environment
  • \n
  • Can not start a new download when a download is in progress
  • \n
", "statusCodes": [ { "httpStatusCode": "202", @@ -213930,7 +213929,8 @@ "httpStatusCode": "422", "description": "

Client Errors

" } - ] + ], + "descriptionHTML": "

Triggers a new download of the environment tarball from the environment's image_url. When the download is finished, the newly downloaded tarball will overwrite the existing environment.

\n

If a download cannot be triggered, you will receive a 422 Unprocessable Entity response.

\n

The possible error messages are:

\n
    \n
  • Cannot modify or delete the default environment
  • \n
  • Can not start a new download when a download is in progress
  • \n
" }, { "serverUrl": "http(s)://HOSTNAME/api/v3", @@ -248869,7 +248869,6 @@ } ], "previews": [], - "descriptionHTML": "

List issues in an organization assigned to the authenticated user.

\n

Note

\n

\nGitHub's REST API considers every pull request an issue, but not every issue is a pull request. For this reason, \"Issues\" endpoints may return both issues and pull requests in the response. You can identify pull requests by the pull_request key. Be aware that the id of a pull request returned from \"Issues\" endpoints will be an issue id. To find out the pull request id, use the \"List pull requests\" endpoint.

\n
\n

This endpoint supports the following custom media types. For more information, see \"Media types.\"

\n
    \n
  • application/vnd.github.raw+json: Returns the raw markdown body. Response will include body. This is the default if you do not pass any specific media type.
  • \n
  • application/vnd.github.text+json: Returns a text only representation of the markdown body. Response will include body_text.
  • \n
  • application/vnd.github.html+json: Returns HTML rendered from the body's markdown. Response will include body_html.
  • \n
  • application/vnd.github.full+json: Returns raw, text, and HTML representations. Response will include body, body_text, and body_html.
  • \n
", "statusCodes": [ { "httpStatusCode": "200", @@ -248879,7 +248878,8 @@ "httpStatusCode": "404", "description": "

Resource not found

" } - ] + ], + "descriptionHTML": "

List issues in an organization assigned to the authenticated user.

\n

Note

\n

\nGitHub's REST API considers every pull request an issue, but not every issue is a pull request. For this reason, \"Issues\" endpoints may return both issues and pull requests in the response. You can identify pull requests by the pull_request key. Be aware that the id of a pull request returned from \"Issues\" endpoints will be an issue id. To find out the pull request id, use the \"List pull requests\" endpoint.

\n
\n

This endpoint supports the following custom media types. For more information, see \"Media types.\"

\n
    \n
  • application/vnd.github.raw+json: Returns the raw markdown body. Response will include body. This is the default if you do not pass any specific media type.
  • \n
  • application/vnd.github.text+json: Returns a text only representation of the markdown body. Response will include body_text.
  • \n
  • application/vnd.github.html+json: Returns HTML rendered from the body's markdown. Response will include body_html.
  • \n
  • application/vnd.github.full+json: Returns raw, text, and HTML representations. Response will include body, body_text, and body_html.
  • \n
" }, { "serverUrl": "http(s)://HOSTNAME/api/v3", @@ -319842,13 +319842,13 @@ } ], "previews": [], - "descriptionHTML": "

Get Hypermedia links to resources accessible in GitHub's REST API

", "statusCodes": [ { "httpStatusCode": "200", "description": "

OK

" } - ] + ], + "descriptionHTML": "

Get Hypermedia links to resources accessible in GitHub's REST API

" }, { "serverUrl": "http(s)://HOSTNAME/api/v3", @@ -320983,7 +320983,6 @@ } ], "previews": [], - "descriptionHTML": "

Each array contains the day number, hour number, and number of commits:

\n
    \n
  • 0-6: Sunday - Saturday
  • \n
  • 0-23: Hour of day
  • \n
  • Number of commits
  • \n
\n

For example, [2, 14, 25] indicates that there were 25 total commits, during the 2:00pm hour on Tuesdays. All times are based on the time zone of individual commits.

", "statusCodes": [ { "httpStatusCode": "200", @@ -320993,7 +320992,8 @@ "httpStatusCode": "204", "description": "

A header with no content is returned.

" } - ] + ], + "descriptionHTML": "

Each array contains the day number, hour number, and number of commits:

\n
    \n
  • 0-6: Sunday - Saturday
  • \n
  • 0-23: Hour of day
  • \n
  • Number of commits
  • \n
\n

For example, [2, 14, 25] indicates that there were 25 total commits, during the 2:00pm hour on Tuesdays. All times are based on the time zone of individual commits.

" } ] }, @@ -330706,7 +330706,6 @@ } ], "previews": [], - "descriptionHTML": "

Lists all the repositories for this user migration.

", "statusCodes": [ { "httpStatusCode": "200", @@ -330716,7 +330715,8 @@ "httpStatusCode": "404", "description": "

Resource not found

" } - ] + ], + "descriptionHTML": "

Lists all the repositories for this user migration.

" } ] }, @@ -341723,13 +341723,13 @@ } ], "previews": [], - "descriptionHTML": "

Gets the audit log for an organization. For more information, see \"Reviewing the audit log for your organization.\"

\n

By default, the response includes up to 30 events from the past three months. Use the phrase parameter to filter results and retrieve older events. For example, use the phrase parameter with the created qualifier to filter events based on when the events occurred. For more information, see \"Reviewing the audit log for your organization.\"

\n

Use pagination to retrieve fewer or more than 30 events. For more information, see \"Using pagination in the REST API.\"

\n

The authenticated user must be an organization owner to use this endpoint.

\n

OAuth app tokens and personal access tokens (classic) need the read:audit_log scope to use this endpoint.

", "statusCodes": [ { "httpStatusCode": "200", "description": "

OK

" } - ] + ], + "descriptionHTML": "

Gets the audit log for an organization. For more information, see \"Reviewing the audit log for your organization.\"

\n

By default, the response includes up to 30 events from the past three months. Use the phrase parameter to filter results and retrieve older events. For example, use the phrase parameter with the created qualifier to filter events based on when the events occurred. For more information, see \"Reviewing the audit log for your organization.\"

\n

Use pagination to retrieve fewer or more than 30 events. For more information, see \"Using pagination in the REST API.\"

\n

The authenticated user must be an organization owner to use this endpoint.

\n

OAuth app tokens and personal access tokens (classic) need the read:audit_log scope to use this endpoint.

" }, { "serverUrl": "http(s)://HOSTNAME/api/v3", @@ -343328,13 +343328,13 @@ } ], "previews": [], - "descriptionHTML": "

List public organization memberships for the specified user.

\n

This method only lists public memberships, regardless of authentication. If you need to fetch all of the organization memberships (public and private) for the authenticated user, use the List organizations for the authenticated user API instead.

", "statusCodes": [ { "httpStatusCode": "200", "description": "

OK

" } - ] + ], + "descriptionHTML": "

List public organization memberships for the specified user.

\n

This method only lists public memberships, regardless of authentication. If you need to fetch all of the organization memberships (public and private) for the authenticated user, use the List organizations for the authenticated user API instead.

" } ], "custom-properties": [ @@ -344949,13 +344949,13 @@ } ], "previews": [], - "descriptionHTML": "

Warning

\n

\nClosing down notice: This operation is closing down and will be removed in the future. Use the \"List custom repository roles\" endpoint instead.

\n
\n

List the custom repository roles available in this organization. For more information on custom repository roles, see \"About custom repository roles.\"

\n

The authenticated user must be administrator of the organization or of a repository of the organization to use this endpoint.

\n

OAuth app tokens and personal access tokens (classic) need the admin:org or repo scope to use this endpoint.

", "statusCodes": [ { "httpStatusCode": "200", "description": "

Response - list of custom role names

" } - ] + ], + "descriptionHTML": "

Warning

\n

\nClosing down notice: This operation is closing down and will be removed in the future. Use the \"List custom repository roles\" endpoint instead.

\n
\n

List the custom repository roles available in this organization. For more information on custom repository roles, see \"About custom repository roles.\"

\n

The authenticated user must be administrator of the organization or of a repository of the organization to use this endpoint.

\n

OAuth app tokens and personal access tokens (classic) need the admin:org or repo scope to use this endpoint.

" }, { "serverUrl": "http(s)://HOSTNAME/api/v3", @@ -346812,7 +346812,6 @@ } ], "previews": [], - "descriptionHTML": "

List all users who are members of an organization. If the authenticated user is also a member of this organization then both concealed and public members will be returned.

", "statusCodes": [ { "httpStatusCode": "200", @@ -346822,7 +346821,8 @@ "httpStatusCode": "422", "description": "

Validation failed, or the endpoint has been spammed.

" } - ] + ], + "descriptionHTML": "

List all users who are members of an organization. If the authenticated user is also a member of this organization then both concealed and public members will be returned.

" }, { "serverUrl": "http(s)://HOSTNAME/api/v3", @@ -346953,7 +346953,6 @@ } ], "previews": [], - "descriptionHTML": "

Removing a user from this list will remove them from all teams and they will no longer have any access to the organization's repositories.

\n

Note

\n

\nIf a user has both direct membership in the organization as well as indirect membership via an enterprise team, only their direct membership will be removed. Their indirect membership via an enterprise team remains until the user is removed from the enterprise team.

\n
", "statusCodes": [ { "httpStatusCode": "204", @@ -346963,7 +346962,8 @@ "httpStatusCode": "403", "description": "

Forbidden

" } - ] + ], + "descriptionHTML": "

Removing a user from this list will remove them from all teams and they will no longer have any access to the organization's repositories.

\n

Note

\n

\nIf a user has both direct membership in the organization as well as indirect membership via an enterprise team, only their direct membership will be removed. Their indirect membership via an enterprise team remains until the user is removed from the enterprise team.

\n
" }, { "serverUrl": "http(s)://HOSTNAME/api/v3", @@ -366177,7 +366177,6 @@ } ], "previews": [], - "descriptionHTML": "

Redeliver a delivery for a webhook configured in an organization.

\n

You must be an organization owner to use this endpoint.

\n

OAuth app tokens and personal access tokens (classic) need admin:org_hook scope. OAuth apps cannot list, view, or edit\nwebhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps.

", "statusCodes": [ { "httpStatusCode": "202", @@ -366191,7 +366190,8 @@ "httpStatusCode": "422", "description": "

Validation failed, or the endpoint has been spammed.

" } - ] + ], + "descriptionHTML": "

Redeliver a delivery for a webhook configured in an organization.

\n

You must be an organization owner to use this endpoint.

\n

OAuth app tokens and personal access tokens (classic) need admin:org_hook scope. OAuth apps cannot list, view, or edit\nwebhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps.

" }, { "serverUrl": "http(s)://HOSTNAME/api/v3", @@ -374560,7 +374560,6 @@ } ], "previews": [], - "descriptionHTML": "

Deletes a package owned by the authenticated user. You cannot delete a public package if any version of the package has more than 5,000 downloads. In this scenario, contact GitHub support for further assistance.

\n

OAuth app tokens and personal access tokens (classic) need the read:packages and delete:packages scopes to use this endpoint. For more information, see \"About permissions for GitHub Packages.\"

", "statusCodes": [ { "httpStatusCode": "204", @@ -374578,7 +374577,8 @@ "httpStatusCode": "404", "description": "

Resource not found

" } - ] + ], + "descriptionHTML": "

Deletes a package owned by the authenticated user. You cannot delete a public package if any version of the package has more than 5,000 downloads. In this scenario, contact GitHub support for further assistance.

\n

OAuth app tokens and personal access tokens (classic) need the read:packages and delete:packages scopes to use this endpoint. For more information, see \"About permissions for GitHub Packages.\"

" }, { "serverUrl": "http(s)://HOSTNAME/api/v3", @@ -379955,7 +379955,6 @@ } ], "previews": [], - "descriptionHTML": "

Restores a specific package version for a user.

\n

You can restore a deleted package under the following conditions:

\n
    \n
  • The package was deleted within the last 30 days.
  • \n
  • The same package namespace and version is still available and not reused for a new package. If the same package namespace is not available, you will not be able to restore your package. In this scenario, to restore the deleted package, you must delete the new package that uses the deleted package's namespace first.
  • \n
\n

If the package_type belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must have admin permissions to the package. For the list of these registries, see \"About permissions for GitHub Packages.\"

\n

OAuth app tokens and personal access tokens (classic) need the read:packages and write:packages scopes to use this endpoint. For more information, see \"About permissions for GitHub Packages.\"

", "statusCodes": [ { "httpStatusCode": "204", @@ -379973,7 +379972,8 @@ "httpStatusCode": "404", "description": "

Resource not found

" } - ] + ], + "descriptionHTML": "

Restores a specific package version for a user.

\n

You can restore a deleted package under the following conditions:

\n
    \n
  • The package was deleted within the last 30 days.
  • \n
  • The same package namespace and version is still available and not reused for a new package. If the same package namespace is not available, you will not be able to restore your package. In this scenario, to restore the deleted package, you must delete the new package that uses the deleted package's namespace first.
  • \n
\n

If the package_type belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must have admin permissions to the package. For the list of these registries, see \"About permissions for GitHub Packages.\"

\n

OAuth app tokens and personal access tokens (classic) need the read:packages and write:packages scopes to use this endpoint. For more information, see \"About permissions for GitHub Packages.\"

" } ] }, @@ -461322,13 +461322,13 @@ } ], "previews": [], - "descriptionHTML": "", "statusCodes": [ { "httpStatusCode": "200", "description": "

OK

" } - ] + ], + "descriptionHTML": "" }, { "serverUrl": "http(s)://HOSTNAME/api/v3", @@ -463240,13 +463240,13 @@ } ], "previews": [], - "descriptionHTML": "

Disables dependency alerts for a repository.\nThe authenticated user must have admin access to the repository. For more information,\nsee \"About security alerts for vulnerable dependencies\".

", "statusCodes": [ { "httpStatusCode": "204", "description": "

No Content

" } - ] + ], + "descriptionHTML": "

Disables dependency alerts for a repository.\nThe authenticated user must have admin access to the repository. For more information,\nsee \"About security alerts for vulnerable dependencies\".

" }, { "serverUrl": "http(s)://HOSTNAME/api/v3", @@ -542814,13 +542814,13 @@ } ], "previews": [], - "descriptionHTML": "

Lists the people who the specified user follows.

", "statusCodes": [ { "httpStatusCode": "200", "description": "

OK

" } - ] + ], + "descriptionHTML": "

Lists the people who the specified user follows.

" }, { "serverUrl": "http(s)://HOSTNAME/api/v3", diff --git a/src/rest/scripts/openapi-check.js b/src/rest/scripts/openapi-check.ts similarity index 72% rename from src/rest/scripts/openapi-check.js rename to src/rest/scripts/openapi-check.ts index adc9414b4ea7..d9efa87ec34c 100755 --- a/src/rest/scripts/openapi-check.js +++ b/src/rest/scripts/openapi-check.ts @@ -10,6 +10,10 @@ import { globSync } from 'glob' import { program } from 'commander' import { createOperations, processOperations } from './utils/get-operations' +interface ProgramOptions { + files: string[] +} + program .description('Generate dereferenced OpenAPI and decorated schema files.') .requiredOption( @@ -18,9 +22,9 @@ program ) .parse(process.argv) -const filenames = program.opts().files +const filenames: string[] = (program.opts() as ProgramOptions).files -const filesToCheck = filenames.flatMap((filename) => globSync(filename)) +const filesToCheck: string[] = filenames.flatMap((filename: string) => globSync(filename)) if (filesToCheck.length) { check(filesToCheck) @@ -29,22 +33,22 @@ if (filesToCheck.length) { process.exit(1) } -async function check(files) { +async function check(files: string[]): Promise { console.log('Verifying OpenAPI files are valid with decorator') - const documents = files.map((filename) => [ + const documents: [string, any][] = files.map((filename: string) => [ filename, - JSON.parse(fs.readFileSync(path.join(filename))), + JSON.parse(fs.readFileSync(path.join(filename), 'utf8')), ]) - for (const [filename, schema] of documents) { + for (const [filename, schema] of documents as [string, any][]) { try { // munge OpenAPI definitions object in an array of operations objects const operations = await createOperations(schema) // process each operation, asynchronously rendering markdown and stuff - await processOperations(operations) + await processOperations(operations, {}) console.log(`Successfully could decorate OpenAPI operations for document ${filename}`) - } catch (error) { + } catch (error: unknown) { console.error(error) console.log( `🐛 Whoops! It looks like the decorator script wasn't able to parse the dereferenced schema in file ${filename}. A recent change may not yet be supported by the decorator. Please reach out in the #docs-engineering slack channel for help.`,