@@ -14,14 +14,9 @@ import { AuthenticationError, CancellationError, RequestClientError } from '../.
14
14
import type { PagedResult } from '../../git/gitProvider' ;
15
15
import type { Account , UnidentifiedAuthor } from '../../git/models/author' ;
16
16
import 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' ;
25
20
import type { RepositoryMetadata } from '../../git/models/repositoryMetadata' ;
26
21
import type { PullRequestUrlIdentity } from '../../git/utils/pullRequest.utils' ;
27
22
import { showIntegrationDisconnectedTooManyFailedRequestsWarningMessage } from '../../messages' ;
@@ -418,16 +413,16 @@ export abstract class IntegrationBase<
418
413
async searchMyIssues (
419
414
resource ?: ResourceDescriptor ,
420
415
cancellation ?: CancellationToken ,
421
- ) : Promise < SearchedIssue [ ] | undefined > ;
416
+ ) : Promise < IssueShape [ ] | undefined > ;
422
417
async searchMyIssues (
423
418
resources ?: ResourceDescriptor [ ] ,
424
419
cancellation ?: CancellationToken ,
425
- ) : Promise < SearchedIssue [ ] | undefined > ;
420
+ ) : Promise < IssueShape [ ] | undefined > ;
426
421
@debug ( )
427
422
async searchMyIssues (
428
423
resources ?: ResourceDescriptor | ResourceDescriptor [ ] ,
429
424
cancellation ?: CancellationToken ,
430
- ) : Promise < SearchedIssue [ ] | undefined > {
425
+ ) : Promise < IssueShape [ ] | undefined > {
431
426
const scope = getLogScope ( ) ;
432
427
const connected = this . maybeConnected ?? ( await this . isConnected ( ) ) ;
433
428
if ( ! connected ) return undefined ;
@@ -441,21 +436,21 @@ export abstract class IntegrationBase<
441
436
this . resetRequestExceptionCount ( ) ;
442
437
return issues ;
443
438
} catch ( ex ) {
444
- return this . handleProviderException < SearchedIssue [ ] | undefined > ( ex , scope , undefined ) ;
439
+ return this . handleProviderException < IssueShape [ ] | undefined > ( ex , scope , undefined ) ;
445
440
}
446
441
}
447
442
448
443
protected abstract searchProviderMyIssues (
449
444
session : ProviderAuthenticationSession ,
450
445
resources ?: ResourceDescriptor [ ] ,
451
446
cancellation ?: CancellationToken ,
452
- ) : Promise < SearchedIssue [ ] | undefined > ;
447
+ ) : Promise < IssueShape [ ] | undefined > ;
453
448
454
449
@debug ( )
455
450
async getIssueOrPullRequest (
456
451
resource : T ,
457
452
id : string ,
458
- options ?: { expiryOverride ?: boolean | number } ,
453
+ options ?: { expiryOverride ?: boolean | number ; type ?: IssueOrPullRequestType } ,
459
454
) : Promise < IssueOrPullRequest | undefined > {
460
455
const scope = getLogScope ( ) ;
461
456
@@ -469,7 +464,12 @@ export abstract class IntegrationBase<
469
464
( ) => ( {
470
465
value : ( async ( ) => {
471
466
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
+ ) ;
473
473
this . resetRequestExceptionCount ( ) ;
474
474
return result ;
475
475
} catch ( ex ) {
@@ -486,6 +486,7 @@ export abstract class IntegrationBase<
486
486
session : ProviderAuthenticationSession ,
487
487
resource : T ,
488
488
id : string ,
489
+ type : undefined | IssueOrPullRequestType ,
489
490
) : Promise < IssueOrPullRequest | undefined > ;
490
491
491
492
@debug ( )
@@ -660,7 +661,7 @@ export abstract class IssueIntegration<
660
661
async getIssuesForProject (
661
662
project : T ,
662
663
options ?: { user ?: string ; filters ?: IssueFilter [ ] } ,
663
- ) : Promise < SearchedIssue [ ] | undefined > {
664
+ ) : Promise < IssueShape [ ] | undefined > {
664
665
const connected = this . maybeConnected ?? ( await this . isConnected ( ) ) ;
665
666
if ( ! connected ) return undefined ;
666
667
@@ -669,15 +670,15 @@ export abstract class IssueIntegration<
669
670
this . resetRequestExceptionCount ( ) ;
670
671
return issues ;
671
672
} catch ( ex ) {
672
- return this . handleProviderException < SearchedIssue [ ] | undefined > ( ex , undefined , undefined ) ;
673
+ return this . handleProviderException < IssueShape [ ] | undefined > ( ex , undefined , undefined ) ;
673
674
}
674
675
}
675
676
676
677
protected abstract getProviderIssuesForProject (
677
678
session : ProviderAuthenticationSession ,
678
679
project : T ,
679
680
options ?: { user ?: string ; filters ?: IssueFilter [ ] } ,
680
- ) : Promise < SearchedIssue [ ] | undefined > ;
681
+ ) : Promise < IssueShape [ ] | undefined > ;
681
682
}
682
683
683
684
export abstract class HostingIntegration <
@@ -1293,18 +1294,18 @@ export abstract class HostingIntegration<
1293
1294
repo ?: T ,
1294
1295
cancellation ?: CancellationToken ,
1295
1296
silent ?: boolean ,
1296
- ) : Promise < IntegrationResult < SearchedPullRequest [ ] | undefined > > ;
1297
+ ) : Promise < IntegrationResult < PullRequest [ ] | undefined > > ;
1297
1298
async searchMyPullRequests (
1298
1299
repos ?: T [ ] ,
1299
1300
cancellation ?: CancellationToken ,
1300
1301
silent ?: boolean ,
1301
- ) : Promise < IntegrationResult < SearchedPullRequest [ ] | undefined > > ;
1302
+ ) : Promise < IntegrationResult < PullRequest [ ] | undefined > > ;
1302
1303
@debug ( )
1303
1304
async searchMyPullRequests (
1304
1305
repos ?: T | T [ ] ,
1305
1306
cancellation ?: CancellationToken ,
1306
1307
silent ?: boolean ,
1307
- ) : Promise < IntegrationResult < SearchedPullRequest [ ] | undefined > > {
1308
+ ) : Promise < IntegrationResult < PullRequest [ ] | undefined > > {
1308
1309
const scope = getLogScope ( ) ;
1309
1310
const connected = this . maybeConnected ?? ( await this . isConnected ( ) ) ;
1310
1311
if ( ! connected ) return undefined ;
@@ -1329,7 +1330,7 @@ export abstract class HostingIntegration<
1329
1330
repos ?: T [ ] ,
1330
1331
cancellation ?: CancellationToken ,
1331
1332
silent ?: boolean ,
1332
- ) : Promise < SearchedPullRequest [ ] | undefined > ;
1333
+ ) : Promise < PullRequest [ ] | undefined > ;
1333
1334
1334
1335
async searchPullRequests (
1335
1336
searchQuery : string ,
0 commit comments