Research
Security News
Threat Actor Exposes Playbook for Exploiting npm to Build Blockchain-Powered Botnets
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
@octokit/plugin-rest-endpoint-methods
Advanced tools
Octokit plugin adding one method for all of api.github.com REST API endpoints
The @octokit/plugin-rest-endpoint-methods package is a plugin for Octokit, a GitHub SDK, that provides methods for calling GitHub's REST API endpoints. It simplifies the process of making REST API calls to GitHub by providing pre-defined methods for many of the API endpoints, allowing developers to interact with GitHub data and perform actions like repository management, issue tracking, and more without having to manually construct HTTP requests.
Repository Management
This feature allows users to create a new repository on GitHub. The provided code sample demonstrates how to create a new repository for the authenticated user.
{"octokit.rest.repos.createForAuthenticatedUser({ name: 'my-new-repo' })"}
Issues Management
This feature enables users to create new issues in a repository. The code sample shows how to create an issue in the 'hello-world' repository owned by 'octocat' with a title and body.
{"octokit.rest.issues.create({ owner: 'octocat', repo: 'hello-world', title: 'New issue', body: 'Hello, world!' })"}
Pull Requests
This feature allows users to create pull requests in a repository. The code sample illustrates creating a pull request in the 'hello-world' repository, specifying the title, feature branch, and base branch.
{"octokit.rest.pulls.create({ owner: 'octocat', repo: 'hello-world', title: 'Amazing new feature', head: 'feature-branch-name', base: 'main' })"}
The 'github' package is a Node.js wrapper for GitHub's REST API. It offers similar functionalities to @octokit/plugin-rest-endpoint-methods but is less modular and does not provide the plugin architecture that Octokit does. It's an older package and might not be as actively maintained.
Similar to 'github', 'node-github' is another Node.js client for GitHub's REST API. It provides access to GitHub's API endpoints but lacks the extensibility and plugin-based architecture of Octokit. It's another option for developers looking to interact with GitHub programmatically.
Octokit plugin adding one method for all of api.github.com REST API endpoints
Browsers |
Load
|
---|---|
Node |
Install with
|
const MyOctokit = Octokit.plugin(restEndpointMethods);
const octokit = new MyOctokit({ auth: "secret123" });
// https://developer.github.com/v3/users/#get-the-authenticated-user
octokit.rest.users.getAuthenticated();
There is one method for each REST API endpoint documented at https://developer.github.com/v3. All endpoint methods are documented in the docs/ folder, e.g. docs/users/getAuthenticated.md
Parameter and response types for all endpoint methods exported as { RestEndpointMethodTypes }
.
Example
import { RestEndpointMethodTypes } from "@octokit/plugin-rest-endpoint-methods";
type UpdateLabelParameters = RestEndpointMethodTypes["issues"]["updateLabel"]["parameters"];
type UpdateLabelResponse = RestEndpointMethodTypes["issues"]["updateLabel"]["response"];
In order to get types beyond parameters and responses, check out @octokit/openapi-types
, which is a direct transpliation from GitHub's official OpenAPI specification.
See CONTRIBUTING.md
FAQs
Octokit plugin adding one method for all of api.github.com REST API endpoints
The npm package @octokit/plugin-rest-endpoint-methods receives a total of 0 weekly downloads. As such, @octokit/plugin-rest-endpoint-methods popularity was classified as not popular.
We found that @octokit/plugin-rest-endpoint-methods demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 4 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.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
Security News
NVD’s backlog surpasses 20,000 CVEs as analysis slows and NIST announces new system updates to address ongoing delays.
Security News
Research
A malicious npm package disguised as a WhatsApp client is exploiting authentication flows with a remote kill switch to exfiltrate data and destroy files.