Giter Site home page Giter Site logo

jtamsut / plugin-rest-endpoint-methods.js Goto Github PK

View Code? Open in Web Editor NEW

This project forked from octokit/plugin-rest-endpoint-methods.js

0.0 0.0 0.0 9.05 MB

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

License: MIT License

JavaScript 1.34% TypeScript 98.66%

plugin-rest-endpoint-methods.js's Introduction

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.skypack.dev

<script type="module">
  import { Octokit } from "https://cdn.skypack.dev/@octokit/core";
  import { restEndpointMethods } from "https://cdn.skypack.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.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

TypeScript

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 transpilation from GitHub's official OpenAPI specification.

Contributing

See CONTRIBUTING.md

License

MIT

plugin-rest-endpoint-methods.js's People

Contributors

gr2m avatar dependabot[bot] avatar renovate[bot] avatar octokitbot avatar github-actions[bot] avatar greenkeeper[bot] avatar timrogers avatar wolfy1339 avatar oscard0m avatar nickfloyd avatar kfcampbell avatar fetsorn avatar copperwall avatar eladchen avatar jaredegolf avatar jsoref avatar jhutchings1 avatar kevinoid avatar jumplink avatar srawlins avatar iamhughes avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.