github-pages-deploy-action/node_modules/@octokit/plugin-rest-endpoint-methods
2020-07-04 15:43:39 -04:00
..
dist-node 3.5.7 Dependencies 2020-07-04 15:43:39 -04:00
dist-src 3.5.7 Dependencies 2020-07-04 15:43:39 -04:00
dist-types 3.5.7 Dependencies 2020-07-04 15:43:39 -04:00
dist-web 3.5.7 Dependencies 2020-07-04 15:43:39 -04:00
node_modules/@octokit/types 3.5.7 Dependencies 2020-07-04 15:43:39 -04:00
LICENSE Dependencies 2020-03-02 08:16:42 -05:00
package.json 3.5.7 Dependencies 2020-07-04 15:43:39 -04:00
README.md 3.5.7 Dependencies 2020-07-04 15:43:39 -04:00

plugin-rest-endpoint-methods.js

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

@latest Build Status

Usage

Browsers

Load @octokit/plugin-rest-endpoint-methods and @octokit/core (or core-compatible module) directly from cdn.pika.dev

<script type="module">
  import { Octokit } from "https://cdn.pika.dev/@octokit/core";
  import { restEndpointMethods } from "https://cdn.pika.dev/@octokit/plugin-rest-endpoint-methods";
</script>
Node

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

const { Octokit } = require("@octokit/core");
const {
  restEndpointMethods,
} = require("@octokit/plugin-rest-endpoint-methods");
const MyOctokit = Octokit.plugin(restEndpointMethods);
const octokit = new MyOctokit({ auth: "secret123" });

// https://developer.github.com/v3/users/#get-the-authenticated-user
octokit.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

TypeScript

Parameter and response types for all endpoint methods exported as { RestEndpointMethodTypes }.

Example

import { RestEndpointMethodTypes } from "@octokit/rest-endpoint-methods";

type UpdateLabelParameters = RestEndpointMethodTypes["issues"]["updateLabel"]["parameters"];
type UpdateLabelResponse = RestEndpointMethodTypes["issues"]["updateLabel"]["response"];

Contributing

See CONTRIBUTING.md

License

MIT