Skip to content

Commit eceab7b

Browse files
committed
refactor(api): use @octokit/types REST schema type
Signed-off-by: Adam Setch <[email protected]>
1 parent 05f95f7 commit eceab7b

File tree

3 files changed

+17
-0
lines changed

3 files changed

+17
-0
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@
8383
"@electron/notarize": "3.1.1",
8484
"@graphql-codegen/cli": "6.1.0",
8585
"@graphql-codegen/schema-ast": "5.0.0",
86+
"@octokit/openapi-types": "^27.0.0",
8687
"@parcel/watcher": "2.5.1",
8788
"@primer/css": "22.0.2",
8889
"@primer/octicons-react": "19.21.1",

pnpm-lock.yaml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/renderer/typesGitHub.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// import type { components } from '@octokit/openapi-types';
2+
13
import type { GitifyNotification, GitifySubject, Link } from './types';
24

35
// TODO: #828 Add explicit types for GitHub API response vs Gitify Notifications object
@@ -46,6 +48,7 @@ export type UserType =
4648
| 'Organization'
4749
| 'User';
4850

51+
// export type Notification = components['schemas']['thread'];
4952
export interface GitHubNotification {
5053
id: string;
5154
unread: boolean;
@@ -119,6 +122,7 @@ export interface User {
119122
site_admin: boolean;
120123
}
121124

125+
// export type Repository = components['schemas']['repository'];
122126
export interface Repository {
123127
id: number;
124128
node_id: string;
@@ -189,6 +193,7 @@ export interface Owner {
189193
site_admin: boolean;
190194
}
191195

196+
// export type Commit = components['schemas']['commit'];
192197
export interface Commit {
193198
sha: string;
194199
node_id: string;
@@ -260,6 +265,7 @@ export interface CommitComment {
260265
body: string;
261266
}
262267

268+
// export type Release = components['schemas']['release'];
263269
export interface Release {
264270
url: Link;
265271
assets_url: Link;
@@ -283,6 +289,8 @@ export interface GitHubRESTError {
283289
documentation_url: Link;
284290
}
285291

292+
// export type NotificationThreadSubscription =
293+
// components['schemas']['thread-subscription'];
286294
export interface NotificationThreadSubscription {
287295
subscribed: boolean;
288296
ignored: boolean;

0 commit comments

Comments
 (0)