@octokit-next/types-rest-api v2.8.0
@octokit-next/types-rest-api
Types for github.com REST API requests and responses
🚫⚠️ This package is part of an experimental Octokit SDK for testing purpose only - DO NOT USE
Usage
Importing the package will add all of GitHub's REST API endpoints to the Octokit.ApiVersions["github.com"]
interface
import "@octokit-next/types-rest-api";
The package also exports an Operation
generic which turns a REST API endpoint defined in a transpiled OpenAPI spec to an Endpoint
object with parameters
, request
, and response
keys.
import { paths } from "@octokit-next/types-openapi";
import { Operation } from "@octokit-next/types-rest-api";
type MyEndpoint = Operation<paths, "GET", "/">;
The Operation
call signature is
Operation<paths, method, path[, requiredPreview]>
paths
is the paths object from a transpiled OpenAPI spec usingopenapi-typescript
, such as any of the@octokit-next/types-openapi*
packagesmethod
is the HTTP method, such asget
,post
,patch
, etc. (lowercase)path
is the path to the endpoint, such as/repos/:owner/:repo
requiredPreview
is a string of the name of the preview if one is required in order to use that endpoint
1 month ago
10 months ago
1 year ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago