- Notifications
You must be signed in to change notification settings - Fork60
Octokit plugin adding one method for all of api.github.com REST API endpoints
License
octokit/plugin-rest-endpoint-methods.js
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Octokit plugin adding one method for all of api.github.com REST API endpoints
Browsers | Load <scripttype="module">import{Octokit}from"https://esm.sh/@octokit/core";import{restEndpointMethods}from"https://esm.sh/@octokit/plugin-rest-endpoint-methods";</script> |
---|---|
Node | Install with import{Octokit}from"@octokit/core";import{restEndpointMethods}from"@octokit/plugin-rest-endpoint-methods"; |
constMyOctokit=Octokit.plugin(restEndpointMethods);constoctokit=newMyOctokit({auth:"secret123"});// https://developer.github.com/v3/users/#get-the-authenticated-useroctokit.rest.users.getAuthenticated();
There is one method for each REST API endpoint documented athttps://developer.github.com/v3. All endpoint methods are documented in thedocs/ folder, e.g.docs/users/getAuthenticated.md
Important
As we useconditional exports, you will need to adapt yourtsconfig.json
by setting"moduleResolution": "node16", "module": "node16"
.
See the TypeScript docs onpackage.json "exports".
See thishelpful guide on transitioning to ESM from@sindresorhus
Parameter and response types for all endpoint methods exported as{ RestEndpointMethodTypes }
.
Example
import{RestEndpointMethodTypes}from"@octokit/plugin-rest-endpoint-methods";typeUpdateLabelParameters=RestEndpointMethodTypes["issues"]["updateLabel"]["parameters"];typeUpdateLabelResponse=RestEndpointMethodTypes["issues"]["updateLabel"]["response"];
In order to get types beyond parameters and responses, check out@octokit/openapi-types
, which is a direct transpilation from GitHub's official OpenAPI specification.
About
Octokit plugin adding one method for all of api.github.com REST API endpoints
Topics
Resources
License
Code of conduct
Security policy
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.