Security News
Introducing the Socket Python SDK
The initial version of the Socket Python SDK is now on PyPI, enabling developers to more easily interact with the Socket REST API in Python projects.
@octokit/routes
Advanced tools
Machine-readable, always up-to-date GitHub REST API route specifications
machine-readable, always up-to-date GitHub REST API route specifications
repos
: octokit.github.io/routes/routes/repos.jsonGET /repos/:owner/:repo
: octokit.github.io/routes/routes/repos/get.jsonExample route definition
{
"name": "Lock an issue",
"enabledForApps": true,
"method": "PUT",
"path": "/repos/:owner/:repo/issues/:number/lock",
"params": [
{
"name": "lock_reason",
"type": "string",
"description": "The reason for locking the issue or pull request conversation. Lock will fail if you don't use one of these reasons: \n\\* `off-topic` \n\\* `too heated` \n\\* `resolved` \n\\* `spam`",
"required": false
}
],
"description": "Users with push access can lock an issue or pull request's conversation.\n\nNote that, if you choose not to pass any parameters, you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see \"[HTTP verbs](/v3/#http-verbs).\"",
"documentationUrl": "https://developer.github.com/v3/issues/#lock-an-issue"
}
const ROUTES = require('@octokit/routes')
returns an object with keys being the route scopes such as activity
, issues
,
repositories
, etc (one for navigation header in the sidebar at https://developer.github.com/v3/).
The value for each scope is an array of REST API endpoint specification.
If you don’t need all routes definitions, you can require a scope or a specific route definition instead
const REPO_ROUTES = require('@octokit/routes/routes/repos')
const GET_REPO_ROUTE = require('@octokit/routes/routes/repos/get')
This package updates itself using a daily cronjob running on Travis. All
routes/*.json
files as well as index.js
is
generated by bin/octokit-rest-routes.js
. Run
node bin/octokit-rest-routes.js --usage
for instructions.
The update script is scraping GitHub’s REST API documentation pages and extracts the meta information using cheerio and a ton of regular expressions :)
For simpler local testing and tracking of changes all loaded pages are cached
in the cache/
folder.
cache/v3/index.html
cache/pages.json
Opens https://developer.github.com/v3/, find all documentation page URLs in the side bar navigation.
cache/v3/*/index.html
, e.g. cache/v3/repos/index.html
cache/v3/*/*/index.html
, e.g. cache/v3/repos/branches/index.html
index.html
files, e.g. cache/v3/repos/sections.json
index.html
files, e.g. cache/v3/repos/create.html
Loads HTML of each documentation page, finds sections in page.
Loads HTML of documentation page section. Turns it into routes/*.json
file.
In some cases the HTML cannot be turned into an endpoint using the implemented patterns.
For these cases custom overrides are defined.
FAQs
Machine-readable, always up-to-date GitHub REST API route specifications
The npm package @octokit/routes receives a total of 14 weekly downloads. As such, @octokit/routes popularity was classified as not popular.
We found that @octokit/routes demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The initial version of the Socket Python SDK is now on PyPI, enabling developers to more easily interact with the Socket REST API in Python projects.
Security News
Floating dependency ranges in npm can introduce instability and security risks into your project by allowing unverified or incompatible versions to be installed automatically, leading to unpredictable behavior and potential conflicts.
Security News
A new Rust RFC proposes "Trusted Publishing" for Crates.io, introducing short-lived access tokens via OIDC to improve security and reduce risks associated with long-lived API tokens.