Skip to content

Commit 7269e45

Browse files
committed
fix: use @octokit/types as type only
1 parent 01af91c commit 7269e45

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/services/github.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Import Third-party Dependencies
22
import * as httpie from "@myunisoft/httpie";
3-
import * as Octokit from "@octokit/types";
3+
import type { Endpoints } from "@octokit/types";
44
import { fetchLazy } from "@dashlog/fetch-github-repositories";
55

66
// Import Internal Dependencies
@@ -34,7 +34,7 @@ export default class Github {
3434
}
3535

3636
async information() {
37-
const { data } = await httpie.get<Octokit.Endpoints["GET /orgs/{org}"]["response"]["data"]>(
37+
const { data } = await httpie.get<Endpoints["GET /orgs/{org}"]["response"]["data"]>(
3838
`https://api.github.com/orgs/${this.orgName}`,
3939
{ headers: this.headers }
4040
);

src/services/repository.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import path from "node:path";
33

44
// Import Third-party Dependencies
55
import * as httpie from "@myunisoft/httpie";
6-
import * as Octokit from "@octokit/types";
6+
import type { Endpoints } from "@octokit/types";
77
import * as Dashlog from "@dashlog/fetch-github-repositories";
88
import { packument } from "@nodesecure/npm-registry-sdk";
99
import type { PackageJSON } from "@nodesecure/npm-types";
@@ -54,7 +54,7 @@ export interface DashlogRepository<PluginsGeneric extends object = any> {
5454
export default class Repository {
5555
#org: Github;
5656
#repository: Dashlog.Repository;
57-
#commits: Octokit.Endpoints["GET /repos/{owner}/{repo}/commits"]["response"]["data"];
57+
#commits: Endpoints["GET /repos/{owner}/{repo}/commits"]["response"]["data"];
5858

5959
constructor(org: Github, repository: Dashlog.Repository) {
6060
this.#org = org;
@@ -69,10 +69,10 @@ export default class Repository {
6969
const pull = pulls_url.slice(0, pulls_url.length - kPullUrlPostfixLen);
7070
const issue = issues_url.slice(0, issues_url.length - kPullUrlPostfixLen);
7171

72-
const { data: pulls } = await httpie.get<Octokit.Endpoints["GET /repos/{owner}/{repo}/pulls"]["response"]["data"]>(
72+
const { data: pulls } = await httpie.get<Endpoints["GET /repos/{owner}/{repo}/pulls"]["response"]["data"]>(
7373
pull, { headers: this.#org.headers }
7474
);
75-
const { data: issues } = await httpie.get<Octokit.Endpoints["GET /repos/{owner}/{repo}/issues"]["response"]["data"]>(
75+
const { data: issues } = await httpie.get<Endpoints["GET /repos/{owner}/{repo}/issues"]["response"]["data"]>(
7676
issue, { headers: this.#org.headers }
7777
);
7878

@@ -93,7 +93,7 @@ export default class Repository {
9393
const url = new URL(this.#repository.commits_url.slice(0, this.#repository.commits_url.length - kCommitUrlPostfixLen));
9494
url.searchParams.set("per_page", kMaxCommitFetch.toString());
9595

96-
const { data: commits } = await httpie.get<Octokit.Endpoints["GET /repos/{owner}/{repo}/commits"]["response"]["data"]>(
96+
const { data: commits } = await httpie.get<Endpoints["GET /repos/{owner}/{repo}/commits"]["response"]["data"]>(
9797
url, { headers: this.#org.headers }
9898
);
9999
this.#commits = commits;

0 commit comments

Comments
 (0)