Big update!Introducing GitHub Bot Commands. Learn more
Socket
Log inBook a demo

@octokit/types

Package Overview
Dependencies
1
Maintainers
4
Versions
168
Issues
File Explorer

Advanced tools

@octokit/types

Shared TypeScript definitions for Octokit projects

    8.0.0latest

Version published
Maintainers
4
Weekly downloads
7,891,509
decreased by-9.7%

Weekly downloads

Changelog

Source

v8.0.0

8.0.0 (2022-10-12)

BREAKING CHANGES

  • @octokit/types no longer include endpoint types for GHEC

Features

  • feat: publish new GitHub Enterprise Cloud (GHEC) specific @octokit/openapi-types-ghec package, plus lots of API changes (29539cf)
  • feat: add support for new "Get a Dependabot alert" API (GET /repos/{owner}/{repo}/dependabot/alerts/{alert_number})
  • feat: add support for new "Update a Dependabot alert" API (PATCH /repos/{owner}/{repo}/dependabot/alerts/{alert_number})
  • feat: add support for new "List Dependabot alerts for a repository" API (GET /repos/{owner}/{repo}/dependabot/alerts)
    • feat: add support for new "List organization secret" (GET /organizations/{org}/codespaces/secrets) Codespaces API
  • feat: add support for new "Get an organization public key" (GET /organizations/{org}/codespaces/secrets/public-key) Codespaces API
  • feat: add support for new "Get an organization secret" (GET /organizations/{org}/codespaces/secrets/{secret_name} ) Codespaces API
  • feat: adds support for new "Create or update an organization secret" (PUT /organizations/{org}/codespaces/secrets/{secret_name} ) Codespaces API
  • feat: add support for new "Delete an organization secret" (DELETE /organizations/{org}/codespaces/secrets/{secret_name}) Codespaces API
  • feat: add support for new "List selected repositories for an organization secret" (GET /organizations/{org}/codespaces/secrets/{secret_name}/repositories) Codespaces API
  • feat: add support for new "Set selected repositories for an organization secret" ( PUT /organizations/{org}/codespaces/secrets/{secret_name}/repositories) Codespaces API
  • feat: add support for new "Add selected repository to an organization secret" (PUT /organizations/{org}/codespaces/secrets/{secret_name}/repositories/{repository_id}) Codespaces API
  • feat: add support for new "Remove selected repository from an organization secret" (DELETE /organizations/{org}/codespaces/secrets/{secret_name}/repositories/{repository_id}) Codespaces API
  • feat: add support for resolution_comment attribute returned on secret scanning alerts
  • feat: add support for new scope attribute returned by the "Get a diff of the dependencies between commits" (GET /repos/{owner}/{repo}/dependency-graph/compare/{basehead}) API
  • deps: update @octokit/openapi-types to v14 (#463) (7bf7e20)

### Fixes

  • fix: tweak documentation for repo starring related APIs (GET /repos/{owner}/{repo}/stargazers, GET /users/{username}/starred and GET /user/starred) to clarify what Accept header to send to get information about when stars were created
  • fix: tweak documentation for "Get community profile metrics" API (GET /repos/{owner}/{repo}/community/profile) to clarify that it only works with public repos which are not forks
  • fix: document the size attribute returned on repos across the API
  • fix: document that APIs can return 422 errors when an endpoint has been spammed with many requests
  • fix: document 301 status returned by labels-related APIs if the repo has been renamed or moved
  • fix: document 404 Not Found status returned by labels-related APIs

Readme

Source

types.ts

Shared TypeScript definitions for Octokit projects

@latest Build Status

Usage

See all exported types at https://octokit.github.io/types.ts

Examples

Get parameter and response data types for a REST API endpoint

import { Endpoints } from "@octokit/types"; type listUserReposParameters = Endpoints["GET /repos/{owner}/{repo}"]["parameters"]; type listUserReposResponse = Endpoints["GET /repos/{owner}/{repo}"]["response"]; async function listRepos( options: listUserReposParameters ): listUserReposResponse["data"] { // ... }

Get response types from endpoint methods

import { GetResponseTypeFromEndpointMethod, GetResponseDataTypeFromEndpointMethod, } from "@octokit/types"; import { Octokit } from "@octokit/rest"; const octokit = new Octokit(); type CreateLabelResponseType = GetResponseTypeFromEndpointMethod< typeof octokit.issues.createLabel >; type CreateLabelResponseDataType = GetResponseDataTypeFromEndpointMethod< typeof octokit.issues.createLabel >;

Contributing

See CONTRIBUTING.md

License

MIT

Keywords

FAQs

What is @octokit/types?

Shared TypeScript definitions for Octokit projects

Is @octokit/types popular?

The npm package @octokit/types receives a total of 7,454,533 weekly downloads. As such, @octokit/types popularity was classified as popular.

Is @octokit/types well maintained?

We found that @octokit/types demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago.It has 4 open source maintainers collaborating on the project.

Last updated on 12 Oct 2022

Did you know?

Socket installs a Github app to automatically flag issues on every pull request and report the health of your dependencies. Find out what is inside your node modules and prevent malicious activity before you update the dependencies.

Install Socket
Socket

Product

Subscribe to our newsletter

Get open source security insights delivered straight into your inbox. Be the first to learn about new features and product updates.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc