@@ -2,19 +2,21 @@ import type { OctokitOptions } from "@octokit/core/dist-types/types";
22import { throttling } from "@octokit/plugin-throttling" ;
33import type { ThrottlingOptions } from "@octokit/plugin-throttling/dist-types/types" ;
44import { Octokit , type RestEndpointMethodTypes } from "@octokit/rest" ;
5- import { inject , singleton } from "tsyringe" ;
5+ import { inject , injectable } from "inversify" ;
6+
7+ import { DI_IDENTIFIERS } from "./diIdentifiers" ;
68
79type PullsListResponseData = RestEndpointMethodTypes [ "pulls" ] [ "get" ] [ "response" ] ;
810type PullsListCommitsResponseData = RestEndpointMethodTypes [ "pulls" ] [ "listCommits" ] [ "response" ] ;
911
10- @singleton ( )
12+ @injectable ( )
1113export class PluginOctokit extends Octokit . plugin ( throttling ) {
1214 private owner : string ;
1315
1416 private repo : string ;
1517
1618 constructor (
17- @inject ( " OctokitOptions" )
19+ @inject ( DI_IDENTIFIERS . OctokitOptions )
1820 props : {
1921 owner : string ;
2022 repo : string ;
@@ -55,13 +57,13 @@ export class PluginOctokit extends Octokit.plugin(throttling) {
5557 private _getPullRequest = async ( pullNumber : number ) => {
5658 const { owner, repo } = this ;
5759
58- const pullRequestDetail :PullsListResponseData = await this . rest . pulls . get ( {
60+ const pullRequestDetail : PullsListResponseData = await this . rest . pulls . get ( {
5961 owner,
6062 repo,
6163 pull_number : pullNumber ,
6264 } ) ;
6365
64- const pullRequestCommits :PullsListCommitsResponseData = await this . rest . pulls . listCommits ( {
66+ const pullRequestCommits : PullsListCommitsResponseData = await this . rest . pulls . listCommits ( {
6567 owner,
6668 repo,
6769 pull_number : pullNumber ,
@@ -73,11 +75,12 @@ export class PluginOctokit extends Octokit.plugin(throttling) {
7375 } ;
7476 } ;
7577
76-
77- public getPullRequests = async ( ) : Promise < {
78- detail : PullsListResponseData ,
79- commitDetails : PullsListCommitsResponseData
80- } [ ] > => {
78+ public getPullRequests = async ( ) : Promise <
79+ {
80+ detail : PullsListResponseData ;
81+ commitDetails : PullsListCommitsResponseData ;
82+ } [ ]
83+ > => {
8184 const { owner, repo } = this ;
8285
8386 const { data } = await this . rest . pulls . list ( {
0 commit comments