@@ -14,14 +14,9 @@ import { AuthenticationError, CancellationError, RequestClientError } from '../.
1414import type { PagedResult } from '../../git/gitProvider' ;
1515import type { Account , UnidentifiedAuthor } from '../../git/models/author' ;
1616import type { DefaultBranch } from '../../git/models/defaultBranch' ;
17- import type { Issue , SearchedIssue } from '../../git/models/issue' ;
18- import type { IssueOrPullRequest } from '../../git/models/issueOrPullRequest' ;
19- import type {
20- PullRequest ,
21- PullRequestMergeMethod ,
22- PullRequestState ,
23- SearchedPullRequest ,
24- } from '../../git/models/pullRequest' ;
17+ import type { Issue , IssueShape } from '../../git/models/issue' ;
18+ import type { IssueOrPullRequest , IssueOrPullRequestType } from '../../git/models/issueOrPullRequest' ;
19+ import type { PullRequest , PullRequestMergeMethod , PullRequestState } from '../../git/models/pullRequest' ;
2520import type { RepositoryMetadata } from '../../git/models/repositoryMetadata' ;
2621import type { PullRequestUrlIdentity } from '../../git/utils/pullRequest.utils' ;
2722import { showIntegrationDisconnectedTooManyFailedRequestsWarningMessage } from '../../messages' ;
@@ -418,16 +413,16 @@ export abstract class IntegrationBase<
418413 async searchMyIssues (
419414 resource ?: ResourceDescriptor ,
420415 cancellation ?: CancellationToken ,
421- ) : Promise < SearchedIssue [ ] | undefined > ;
416+ ) : Promise < IssueShape [ ] | undefined > ;
422417 async searchMyIssues (
423418 resources ?: ResourceDescriptor [ ] ,
424419 cancellation ?: CancellationToken ,
425- ) : Promise < SearchedIssue [ ] | undefined > ;
420+ ) : Promise < IssueShape [ ] | undefined > ;
426421 @debug ( )
427422 async searchMyIssues (
428423 resources ?: ResourceDescriptor | ResourceDescriptor [ ] ,
429424 cancellation ?: CancellationToken ,
430- ) : Promise < SearchedIssue [ ] | undefined > {
425+ ) : Promise < IssueShape [ ] | undefined > {
431426 const scope = getLogScope ( ) ;
432427 const connected = this . maybeConnected ?? ( await this . isConnected ( ) ) ;
433428 if ( ! connected ) return undefined ;
@@ -441,21 +436,21 @@ export abstract class IntegrationBase<
441436 this . resetRequestExceptionCount ( ) ;
442437 return issues ;
443438 } catch ( ex ) {
444- return this . handleProviderException < SearchedIssue [ ] | undefined > ( ex , scope , undefined ) ;
439+ return this . handleProviderException < IssueShape [ ] | undefined > ( ex , scope , undefined ) ;
445440 }
446441 }
447442
448443 protected abstract searchProviderMyIssues (
449444 session : ProviderAuthenticationSession ,
450445 resources ?: ResourceDescriptor [ ] ,
451446 cancellation ?: CancellationToken ,
452- ) : Promise < SearchedIssue [ ] | undefined > ;
447+ ) : Promise < IssueShape [ ] | undefined > ;
453448
454449 @debug ( )
455450 async getIssueOrPullRequest (
456451 resource : T ,
457452 id : string ,
458- options ?: { expiryOverride ?: boolean | number } ,
453+ options ?: { expiryOverride ?: boolean | number ; type ?: IssueOrPullRequestType } ,
459454 ) : Promise < IssueOrPullRequest | undefined > {
460455 const scope = getLogScope ( ) ;
461456
@@ -469,7 +464,12 @@ export abstract class IntegrationBase<
469464 ( ) => ( {
470465 value : ( async ( ) => {
471466 try {
472- const result = await this . getProviderIssueOrPullRequest ( this . _session ! , resource , id ) ;
467+ const result = await this . getProviderIssueOrPullRequest (
468+ this . _session ! ,
469+ resource ,
470+ id ,
471+ options ?. type ,
472+ ) ;
473473 this . resetRequestExceptionCount ( ) ;
474474 return result ;
475475 } catch ( ex ) {
@@ -486,6 +486,7 @@ export abstract class IntegrationBase<
486486 session : ProviderAuthenticationSession ,
487487 resource : T ,
488488 id : string ,
489+ type : undefined | IssueOrPullRequestType ,
489490 ) : Promise < IssueOrPullRequest | undefined > ;
490491
491492 @debug ( )
@@ -660,7 +661,7 @@ export abstract class IssueIntegration<
660661 async getIssuesForProject (
661662 project : T ,
662663 options ?: { user ?: string ; filters ?: IssueFilter [ ] } ,
663- ) : Promise < SearchedIssue [ ] | undefined > {
664+ ) : Promise < IssueShape [ ] | undefined > {
664665 const connected = this . maybeConnected ?? ( await this . isConnected ( ) ) ;
665666 if ( ! connected ) return undefined ;
666667
@@ -669,15 +670,15 @@ export abstract class IssueIntegration<
669670 this . resetRequestExceptionCount ( ) ;
670671 return issues ;
671672 } catch ( ex ) {
672- return this . handleProviderException < SearchedIssue [ ] | undefined > ( ex , undefined , undefined ) ;
673+ return this . handleProviderException < IssueShape [ ] | undefined > ( ex , undefined , undefined ) ;
673674 }
674675 }
675676
676677 protected abstract getProviderIssuesForProject (
677678 session : ProviderAuthenticationSession ,
678679 project : T ,
679680 options ?: { user ?: string ; filters ?: IssueFilter [ ] } ,
680- ) : Promise < SearchedIssue [ ] | undefined > ;
681+ ) : Promise < IssueShape [ ] | undefined > ;
681682}
682683
683684export abstract class HostingIntegration <
@@ -1293,18 +1294,18 @@ export abstract class HostingIntegration<
12931294 repo ?: T ,
12941295 cancellation ?: CancellationToken ,
12951296 silent ?: boolean ,
1296- ) : Promise < IntegrationResult < SearchedPullRequest [ ] | undefined > > ;
1297+ ) : Promise < IntegrationResult < PullRequest [ ] | undefined > > ;
12971298 async searchMyPullRequests (
12981299 repos ?: T [ ] ,
12991300 cancellation ?: CancellationToken ,
13001301 silent ?: boolean ,
1301- ) : Promise < IntegrationResult < SearchedPullRequest [ ] | undefined > > ;
1302+ ) : Promise < IntegrationResult < PullRequest [ ] | undefined > > ;
13021303 @debug ( )
13031304 async searchMyPullRequests (
13041305 repos ?: T | T [ ] ,
13051306 cancellation ?: CancellationToken ,
13061307 silent ?: boolean ,
1307- ) : Promise < IntegrationResult < SearchedPullRequest [ ] | undefined > > {
1308+ ) : Promise < IntegrationResult < PullRequest [ ] | undefined > > {
13081309 const scope = getLogScope ( ) ;
13091310 const connected = this . maybeConnected ?? ( await this . isConnected ( ) ) ;
13101311 if ( ! connected ) return undefined ;
@@ -1329,7 +1330,7 @@ export abstract class HostingIntegration<
13291330 repos ?: T [ ] ,
13301331 cancellation ?: CancellationToken ,
13311332 silent ?: boolean ,
1332- ) : Promise < SearchedPullRequest [ ] | undefined > ;
1333+ ) : Promise < PullRequest [ ] | undefined > ;
13331334
13341335 async searchPullRequests (
13351336 searchQuery : string ,
0 commit comments