forked from github/docs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
reorganize repository apis (github#23728)
Co-authored-by: Lucas Costi <[email protected]> Co-authored-by: Peter Bengtsson <[email protected]>
- Loading branch information
1 parent
d31d6a5
commit a340162
Showing
30 changed files
with
2,904 additions
and
2,699 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import { useEffect } from 'react' | ||
import { useRouter } from 'next/router' | ||
|
||
import overrides from '../../lib/redirects/static/rest-api-redirect-exceptions.json' | ||
const overrideRedirects: Record<string, string> = overrides | ||
|
||
export default function ClientSideRedirectExceptions() { | ||
const router = useRouter() | ||
useEffect(() => { | ||
// We have some one-off redirects for rest api docs | ||
// currently those are limited to the repos page, but | ||
// that will grow soon as we restructure the rest api docs. | ||
// This is a workaround to updating the hardcoded links | ||
// directly in the REST API code in a separate repo, which | ||
// requires many file changes and teams to sign off. | ||
// While the organization is turbulent, we can do this. | ||
// Once it's more settled, we can refactor the rest api code | ||
// to leverage the OpenAPI urls rather than hardcoded urls. | ||
const { hash, pathname } = window.location | ||
|
||
// The `hash` will start with a `#` but all the keys in | ||
// `overrideRedirects` do not. Hence, this slice. | ||
const combined = pathname + hash | ||
const overrideKey = combined | ||
.replace(`/${router.locale}`, '') | ||
.replace(`/${router.query.versionId || ''}`, '') | ||
const redirectToName = overrideRedirects[overrideKey] | ||
if (redirectToName) { | ||
const newPathname = combined.replace(overrideKey, redirectToName) | ||
router.replace(newPathname) | ||
} | ||
}, []) | ||
|
||
return null | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
The webhook REST APIs enable you to manage repository, organization, and app webhooks.{% ifversion fpt or ghes > 3.2 or ghae or ghec %} You can use this API to list webhook deliveries for a webhook, or get and redeliver an individual delivery for a webhook, which can be integrated into an external app or service.{% endif %} You can also use the REST API to change the configuration of the webhook. For example, you can modify the payload URL, content type, SSL verification, and secret. For more information, see: | ||
|
||
- [Repository Webhooks REST API](/rest/reference/repos#webhooks) | ||
- [Repository Webhooks REST API](/rest/reference/webhooks#repository-webhooks) | ||
- [Organization Webhooks REST API](/rest/reference/orgs#webhooks) | ||
- [{% data variables.product.prodname_github_app %} Webhooks REST API](/rest/reference/apps#webhooks) |
Oops, something went wrong.