Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Octokit plugin adding one method for all of api.github.com REST API endpoints

License

NotificationsYou must be signed in to change notification settings

octokit/plugin-rest-endpoint-methods.js

Repository files navigation

Octokit plugin adding one method for all of api.github.com REST API endpoints

@latestBuild Status

Usage

Browsers

Load@octokit/plugin-rest-endpoint-methods and@octokit/core (or core-compatible module) directly fromesm.sh

<scripttype="module">import{Octokit}from"https://esm.sh/@octokit/core";import{restEndpointMethods}from"https://esm.sh/@octokit/plugin-rest-endpoint-methods";</script>
Node

Install withnpm install @octokit/core @octokit/plugin-rest-endpoint-methods. Optionally replace@octokit/core with a compatible module

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

TypeScript

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.

Contributing

SeeCONTRIBUTING.md

License

MIT

About

Octokit plugin adding one method for all of api.github.com REST API endpoints

Topics

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Packages

No packages published

Contributors29


[8]ページ先頭

©2009-2025 Movatter.jp