@gitkraken/core-gitlens 0.66.0 → 0.68.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/dist/git-cli/providers/config.js +2 -2
- package/dist/git-cli/providers/pausedOperations.js +2 -2
- package/dist/git-cli/providers/pausedOperations.js.map +1 -1
- package/dist/git-cli/providers/staging.js +1 -1
- package/dist/ipc/discovery.js +1 -1
- package/dist/plus/agents/providers/claudeCodeTranscript.js +6 -6
- package/dist/plus/agents/providers/claudeCodeTranscript.js.map +1 -1
- package/dist/plus/ai/providers/openAICompatibleProviderBase.js +1 -1
- package/dist/plus/integrations/authentication/configuredIntegrationService.js +2 -2
- package/dist/plus/integrations/authentication/configuredIntegrationService.js.map +1 -1
- package/dist/plus/integrations/authentication/integrationAuthenticationService.d.ts +4 -2
- package/dist/plus/integrations/authentication/integrationAuthenticationService.js +5 -4
- package/dist/plus/integrations/authentication/integrationAuthenticationService.js.map +1 -1
- package/dist/plus/integrations/extensionManager.js.map +1 -1
- package/dist/plus/integrations/index.d.ts +3 -1
- package/dist/plus/integrations/index.js +21 -2
- package/dist/plus/integrations/index.js.map +1 -1
- package/dist/plus/integrations/integrationService.d.ts +34 -6
- package/dist/plus/integrations/integrationService.js +114 -7
- package/dist/plus/integrations/integrationService.js.map +1 -1
- package/dist/plus/integrations/manager.d.ts +12 -0
- package/dist/plus/integrations/models/linearIssueWrites.d.ts +101 -0
- package/dist/plus/integrations/models/linearIssueWrites.js +0 -0
- package/dist/plus/integrations/models/trelloCardWrites.d.ts +117 -0
- package/dist/plus/integrations/models/trelloCardWrites.js +0 -0
- package/dist/plus/integrations/providers/azure/azure.js +2 -2
- package/dist/plus/integrations/providers/github.js +1 -1
- package/dist/plus/integrations/providers/linear.d.ts +6 -6
- package/dist/plus/integrations/providers/linear.js +36 -14
- package/dist/plus/integrations/providers/linear.js.map +1 -1
- package/dist/plus/integrations/providers/linearIssueWriteTransport.d.ts +27 -0
- package/dist/plus/integrations/providers/linearIssueWriteTransport.js +110 -0
- package/dist/plus/integrations/providers/linearIssueWriteTransport.js.map +1 -0
- package/dist/plus/integrations/providers/linearIssueWrites.d.ts +27 -0
- package/dist/plus/integrations/providers/linearIssueWrites.js +310 -0
- package/dist/plus/integrations/providers/linearIssueWrites.js.map +1 -0
- package/dist/plus/integrations/providers/linearIssuesEtag.d.ts +2 -0
- package/dist/plus/integrations/providers/linearIssuesEtag.js +27 -1
- package/dist/plus/integrations/providers/linearIssuesEtag.js.map +1 -1
- package/dist/plus/integrations/providers/providerApiClient.d.ts +2 -2
- package/dist/plus/integrations/providers/providerApiClient.js +5 -5
- package/dist/plus/integrations/providers/providerApiClient.js.map +1 -1
- package/dist/plus/integrations/providers/providerErrors.d.ts +9 -0
- package/dist/plus/integrations/providers/providerErrors.js +1 -1
- package/dist/plus/integrations/providers/providerErrors.js.map +1 -1
- package/dist/plus/integrations/providers/providersApi.d.ts +1 -0
- package/dist/plus/integrations/providers/providersApi.js +9 -5
- package/dist/plus/integrations/providers/providersApi.js.map +1 -1
- package/dist/plus/integrations/providers/trello.d.ts +3 -1
- package/dist/plus/integrations/providers/trello.js +28 -0
- package/dist/plus/integrations/providers/trello.js.map +1 -1
- package/dist/plus/integrations/providers/trelloApi.d.ts +5 -0
- package/dist/plus/integrations/providers/trelloApi.js +9 -0
- package/dist/plus/integrations/providers/trelloApi.js.map +1 -0
- package/dist/plus/integrations/providers/trelloCardWriteTransport.d.ts +28 -0
- package/dist/plus/integrations/providers/trelloCardWriteTransport.js +94 -0
- package/dist/plus/integrations/providers/trelloCardWriteTransport.js.map +1 -0
- package/dist/plus/integrations/providers/trelloCardWrites.d.ts +26 -0
- package/dist/plus/integrations/providers/trelloCardWrites.js +342 -0
- package/dist/plus/integrations/providers/trelloCardWrites.js.map +1 -0
- package/dist/utils/env/node/exec.js +2 -2
- package/docs/integrations.md +84 -1
- package/package.json +1 -1
|
@@ -16,6 +16,8 @@ import { BitbucketServerPullRequestCreateCapabilityResult, BitbucketServerPullRe
|
|
|
16
16
|
import { GitLabIssueCreateOptions, GitLabIssueCreateOptionsResult, GitLabIssueDeleteOptions, GitLabIssueWriteAddress, GitLabIssueWriteOptions, GitLabIssueWriteOptionsResult, GitLabIssueWriteResult, GitLabIssueWriteTargetOptions, GitLabIssueWriteTargetResult } from "./models/gitlabIssueWrites.js";
|
|
17
17
|
import { GitLabMergeRequestCreateOptions, GitLabMergeRequestCreateOptionsResult, GitLabMergeRequestDeleteOptions, GitLabMergeRequestWriteAddress, GitLabMergeRequestWriteOptions, GitLabMergeRequestWriteOptionsResult, GitLabMergeRequestWriteResult, GitLabMergeRequestWriteTargetOptions, GitLabMergeRequestWriteTargetResult } from "./models/gitlabMergeRequestWrites.js";
|
|
18
18
|
import { CaptureRelationshipCurrency, IssueRelationshipWriteOptions, IssueRelationshipWriteResult, IssueRelationshipsOptions, IssueRelationshipsResult } from "./models/issueRelationships.js";
|
|
19
|
+
import { LinearIssueCreateOptions, LinearIssueCreateOptionsResult, LinearIssueDeleteOptions, LinearIssueDeleteResult, LinearIssueWriteOptions, LinearIssueWriteOptionsResult, LinearIssueWriteResult, LinearIssueWriteTargetOptions } from "./models/linearIssueWrites.js";
|
|
20
|
+
import { TrelloCardCreateOptions, TrelloCardCreateOptionsResult, TrelloCardDeleteOptions, TrelloCardDeleteResult, TrelloCardWriteOptions, TrelloCardWriteOptionsResult, TrelloCardWriteResult, TrelloCardWriteTargetOptions } from "./models/trelloCardWrites.js";
|
|
19
21
|
import { IssueFilter, SupportedFilters } from "./providerFilters.js";
|
|
20
22
|
import { IssueEtagInclude, PullRequestEtagInclude } from "./reads/etag.js";
|
|
21
23
|
import { ConnectionStateChangeEvent, CurrentAccountResult, IssueBatchResult, IssueBatchTarget, IssueCountResult, IssueCountScope, ProviderBroadenResult, ProviderLinearProjectShape, ProviderOrganization, ProviderPagedResult, ProviderPullRequestSearchResult, ProviderRepositoryShape, ProviderResult, ProviderSweepResult, PullRequestActivityResult, PullRequestActivityTarget, PullRequestBatchResult, PullRequestBatchTarget, PullRequestBranchResult, PullRequestBranchTarget, PullRequestCheckLogResult, PullRequestCheckLogTarget, PullRequestCountResult, PullRequestCountScope, PullRequestForCommitResult, ResolveRepositoryResult } from "./results.js";
|
|
@@ -1209,6 +1211,16 @@ export interface IntegrationManager {
|
|
|
1209
1211
|
/** KEEP: `expectedExecution: 'train'` is GitLab.com-only. Reconcile `applied: 'maybe'` before another write. */
|
|
1210
1212
|
writeGitLabMergeRequest(options: GitLabMergeRequestWriteOptions): Promise<GitLabMergeRequestWriteResult>;
|
|
1211
1213
|
deleteGitLabMergeRequest(options: GitLabMergeRequestDeleteOptions): Promise<GitLabMergeRequestWriteResult>;
|
|
1214
|
+
getLinearIssueCreateOptions(options: LinearIssueCreateOptions): Promise<LinearIssueCreateOptionsResult>;
|
|
1215
|
+
getLinearIssueWriteOptions(options: LinearIssueWriteTargetOptions): Promise<LinearIssueWriteOptionsResult>;
|
|
1216
|
+
resolveLinearIssueWriteTarget(options: LinearIssueWriteTargetOptions): Promise<LinearIssueWriteResult>;
|
|
1217
|
+
writeLinearIssue(options: LinearIssueWriteOptions): Promise<LinearIssueWriteResult>;
|
|
1218
|
+
deleteLinearIssue(options: LinearIssueDeleteOptions): Promise<LinearIssueDeleteResult>;
|
|
1219
|
+
getTrelloCardCreateOptions(options: TrelloCardCreateOptions): Promise<TrelloCardCreateOptionsResult>;
|
|
1220
|
+
getTrelloCardWriteOptions(options: TrelloCardWriteTargetOptions): Promise<TrelloCardWriteOptionsResult>;
|
|
1221
|
+
resolveTrelloCardWriteTarget(options: TrelloCardWriteTargetOptions): Promise<TrelloCardWriteOptionsResult>;
|
|
1222
|
+
writeTrelloCard(options: TrelloCardWriteOptions): Promise<TrelloCardWriteResult>;
|
|
1223
|
+
deleteTrelloCard(options: TrelloCardDeleteOptions): Promise<TrelloCardDeleteResult>;
|
|
1212
1224
|
getIssueTrackerCreateOptions(options: IssueTrackerCreateOptions): Promise<IssueTrackerCreateOptionsResult>;
|
|
1213
1225
|
getIssueTrackerIssueWriteOptions(options: IssueTrackerIssueWriteOptions): Promise<IssueTrackerIssueWriteOptionsResult>;
|
|
1214
1226
|
writeIssueTrackerIssue(options: IssueTrackerWriteOptions): Promise<IssueTrackerWriteResult>;
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { IssueTrackerWriteFailure } from "./issueTrackerWrites.js";
|
|
2
|
+
//#region ../plus/integrations/src/models/linearIssueWrites.d.ts
|
|
3
|
+
export type LinearIssueWriteScope = {
|
|
4
|
+
connectionId: string;
|
|
5
|
+
organizationId: string;
|
|
6
|
+
teamId: string;
|
|
7
|
+
expectedAccountId?: string;
|
|
8
|
+
expectedOrganizationUrlKey?: string;
|
|
9
|
+
};
|
|
10
|
+
export type LinearIssueCreateOptions = Omit<LinearIssueWriteScope, 'teamId'> & ({
|
|
11
|
+
teamId: string;
|
|
12
|
+
teamKey?: never;
|
|
13
|
+
} | {
|
|
14
|
+
teamKey: string;
|
|
15
|
+
teamId?: never;
|
|
16
|
+
});
|
|
17
|
+
export type LinearIssueWriteTargetOptions = Omit<LinearIssueWriteScope, 'teamId'> & {
|
|
18
|
+
teamId?: string;
|
|
19
|
+
/** Issue identifier (for example ENG-123) or UUID. */
|
|
20
|
+
issue: string;
|
|
21
|
+
expectedIssueId?: string;
|
|
22
|
+
};
|
|
23
|
+
export type LinearIssueMutationTarget = LinearIssueWriteTargetOptions & {
|
|
24
|
+
teamId: string;
|
|
25
|
+
expectedIssueId: string;
|
|
26
|
+
};
|
|
27
|
+
export type LinearIssueWriteOptions = (LinearIssueWriteScope & {
|
|
28
|
+
action: 'create';
|
|
29
|
+
title: string;
|
|
30
|
+
description?: string;
|
|
31
|
+
stateId?: string;
|
|
32
|
+
}) | (LinearIssueMutationTarget & {
|
|
33
|
+
action: 'edit';
|
|
34
|
+
title?: string;
|
|
35
|
+
/** Markdown. Send an empty string to clear the description. */
|
|
36
|
+
description?: string;
|
|
37
|
+
}) | (LinearIssueMutationTarget & {
|
|
38
|
+
action: 'transition';
|
|
39
|
+
stateId: string;
|
|
40
|
+
});
|
|
41
|
+
/** Moves the issue and accessible unarchived sub-issues to Linear's trash, recoverable for 30 days. */
|
|
42
|
+
export type LinearIssueDeleteOptions = LinearIssueMutationTarget & {
|
|
43
|
+
expectedAccountId: string;
|
|
44
|
+
expectedOrganizationUrlKey: string;
|
|
45
|
+
};
|
|
46
|
+
export type LinearIssueWorkflowState = {
|
|
47
|
+
id: string;
|
|
48
|
+
name: string;
|
|
49
|
+
type: string;
|
|
50
|
+
category: 'TO_DO' | 'IN_PROGRESS' | 'DONE' | 'CANCELED';
|
|
51
|
+
};
|
|
52
|
+
type LinearIssueTeam = {
|
|
53
|
+
id: string;
|
|
54
|
+
key: string;
|
|
55
|
+
name: string;
|
|
56
|
+
};
|
|
57
|
+
type LinearIssueWriteContext = {
|
|
58
|
+
ok: true;
|
|
59
|
+
accountId: string;
|
|
60
|
+
organization: {
|
|
61
|
+
id: string;
|
|
62
|
+
urlKey: string;
|
|
63
|
+
url: string;
|
|
64
|
+
name: string;
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
export type LinearIssueReceipt = {
|
|
68
|
+
id: string;
|
|
69
|
+
identifier: string;
|
|
70
|
+
url: string;
|
|
71
|
+
title: string;
|
|
72
|
+
updatedAt: string;
|
|
73
|
+
archivedAt?: string;
|
|
74
|
+
trashed?: true;
|
|
75
|
+
team: LinearIssueTeam;
|
|
76
|
+
state: LinearIssueWorkflowState;
|
|
77
|
+
};
|
|
78
|
+
export type LinearIssueCreateOptionsResult = (LinearIssueWriteContext & {
|
|
79
|
+
team: LinearIssueTeam;
|
|
80
|
+
states: readonly LinearIssueWorkflowState[];
|
|
81
|
+
}) | IssueTrackerWriteFailure;
|
|
82
|
+
export type LinearIssueWriteSuccess = LinearIssueWriteContext & {
|
|
83
|
+
issue: LinearIssueReceipt;
|
|
84
|
+
};
|
|
85
|
+
export type LinearIssueWriteOptionsResult = (LinearIssueWriteSuccess & {
|
|
86
|
+
states: readonly LinearIssueWorkflowState[];
|
|
87
|
+
/** Linear supplies no per-issue permission flags. The mutation evaluates access. */
|
|
88
|
+
permissions: {
|
|
89
|
+
edit: 'unknown';
|
|
90
|
+
delete: 'unknown';
|
|
91
|
+
};
|
|
92
|
+
}) | IssueTrackerWriteFailure;
|
|
93
|
+
export type LinearIssueWriteResult = LinearIssueWriteSuccess | IssueTrackerWriteFailure;
|
|
94
|
+
export type LinearIssueDeleteResult = (LinearIssueWriteSuccess & {
|
|
95
|
+
deletion: {
|
|
96
|
+
trashed: true;
|
|
97
|
+
archivedAt?: string;
|
|
98
|
+
};
|
|
99
|
+
}) | IssueTrackerWriteFailure;
|
|
100
|
+
//#endregion
|
|
101
|
+
//# sourceMappingURL=linearIssueWrites.d.ts.map
|
|
File without changes
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { IssueTrackerWriteFailure } from "./issueTrackerWrites.js";
|
|
2
|
+
//#region ../plus/integrations/src/models/trelloCardWrites.d.ts
|
|
3
|
+
export type TrelloCardWriteScope = {
|
|
4
|
+
connectionId: string;
|
|
5
|
+
expectedAccountId?: string;
|
|
6
|
+
};
|
|
7
|
+
export type TrelloCardCreateOptions = TrelloCardWriteScope & {
|
|
8
|
+
boardId?: string;
|
|
9
|
+
};
|
|
10
|
+
export type TrelloCardWriteTargetOptions = TrelloCardWriteScope & {
|
|
11
|
+
boardId?: string;
|
|
12
|
+
listId?: string;
|
|
13
|
+
cardId: string;
|
|
14
|
+
};
|
|
15
|
+
type TrelloCardListTarget = Required<TrelloCardWriteScope> & {
|
|
16
|
+
boardId: string;
|
|
17
|
+
listId: string;
|
|
18
|
+
};
|
|
19
|
+
export type TrelloCardMutationTarget = TrelloCardListTarget & {
|
|
20
|
+
cardId: string;
|
|
21
|
+
};
|
|
22
|
+
export type TrelloCardWriteOptions = (TrelloCardListTarget & {
|
|
23
|
+
action: 'create';
|
|
24
|
+
name: string;
|
|
25
|
+
description?: string;
|
|
26
|
+
}) | (TrelloCardMutationTarget & {
|
|
27
|
+
action: 'edit';
|
|
28
|
+
name?: string;
|
|
29
|
+
description?: string;
|
|
30
|
+
}) | (TrelloCardMutationTarget & {
|
|
31
|
+
action: 'move';
|
|
32
|
+
destinationBoardId: string;
|
|
33
|
+
destinationListId: string;
|
|
34
|
+
}) | (TrelloCardMutationTarget & {
|
|
35
|
+
action: 'archive' | 'restore';
|
|
36
|
+
});
|
|
37
|
+
export type TrelloCardDeleteOptions = TrelloCardMutationTarget & {
|
|
38
|
+
confirmed: true;
|
|
39
|
+
shortLink: string;
|
|
40
|
+
closed: boolean;
|
|
41
|
+
};
|
|
42
|
+
type TrelloCardUnavailableReason = 'forbidden' | 'board-closed' | 'list-unavailable' | 'card-archived' | 'card-open';
|
|
43
|
+
export type TrelloCardWriteFailure = Pick<IssueTrackerWriteFailure, 'ok' | 'mutationDispatched' | 'applied'> & {
|
|
44
|
+
reason: Exclude<IssueTrackerWriteFailure['reason'], 'transition-unavailable'> | TrelloCardUnavailableReason | 'cross-board-move' | 'confirmation-required';
|
|
45
|
+
};
|
|
46
|
+
export type TrelloCardReceipt = {
|
|
47
|
+
id: string;
|
|
48
|
+
idShort: number;
|
|
49
|
+
shortLink: string;
|
|
50
|
+
url: string;
|
|
51
|
+
name: string;
|
|
52
|
+
desc: string;
|
|
53
|
+
dateLastActivity: string;
|
|
54
|
+
boardId: string;
|
|
55
|
+
listId: string;
|
|
56
|
+
closed: boolean;
|
|
57
|
+
};
|
|
58
|
+
export type TrelloCardWriteList = {
|
|
59
|
+
id: string;
|
|
60
|
+
name: string;
|
|
61
|
+
closed: boolean;
|
|
62
|
+
};
|
|
63
|
+
export type TrelloCardWriteBoard = {
|
|
64
|
+
id: string;
|
|
65
|
+
name: string;
|
|
66
|
+
closed: boolean;
|
|
67
|
+
url: string;
|
|
68
|
+
permission: 'allowed' | 'unknown' | 'forbidden';
|
|
69
|
+
lists: readonly TrelloCardWriteList[];
|
|
70
|
+
};
|
|
71
|
+
export type TrelloCardWriteCapability = {
|
|
72
|
+
status: 'allowed' | 'unknown';
|
|
73
|
+
} | {
|
|
74
|
+
status: 'unavailable';
|
|
75
|
+
reason: TrelloCardUnavailableReason;
|
|
76
|
+
};
|
|
77
|
+
export type TrelloCardWriteAccount = {
|
|
78
|
+
id: string;
|
|
79
|
+
username: string;
|
|
80
|
+
name: string;
|
|
81
|
+
};
|
|
82
|
+
type TrelloCardWriteContext = {
|
|
83
|
+
ok: true;
|
|
84
|
+
connectionId: string;
|
|
85
|
+
accountId: string;
|
|
86
|
+
account: TrelloCardWriteAccount;
|
|
87
|
+
};
|
|
88
|
+
type TrelloCardTargetReceipt = TrelloCardWriteContext & {
|
|
89
|
+
card: TrelloCardReceipt;
|
|
90
|
+
board: TrelloCardWriteBoard;
|
|
91
|
+
list: TrelloCardWriteList;
|
|
92
|
+
};
|
|
93
|
+
export type TrelloCardCreateOptionsResult = ((TrelloCardWriteContext & {
|
|
94
|
+
boards: readonly TrelloCardWriteBoard[];
|
|
95
|
+
}) | TrelloCardWriteFailure) & {
|
|
96
|
+
boardFailures?: readonly {
|
|
97
|
+
boardId: string;
|
|
98
|
+
reason: TrelloCardWriteFailure['reason'];
|
|
99
|
+
}[];
|
|
100
|
+
};
|
|
101
|
+
export type TrelloCardWriteOptionsResult = (TrelloCardTargetReceipt & {
|
|
102
|
+
capabilities: Readonly<Record<'edit' | 'move' | 'archive' | 'restore' | 'delete', TrelloCardWriteCapability>>;
|
|
103
|
+
}) | TrelloCardWriteFailure;
|
|
104
|
+
export type TrelloCardWriteResult = (TrelloCardTargetReceipt & {
|
|
105
|
+
action: Exclude<TrelloCardWriteOptions['action'], 'move'>;
|
|
106
|
+
}) | (TrelloCardTargetReceipt & {
|
|
107
|
+
action: 'move';
|
|
108
|
+
sourceList: TrelloCardWriteList;
|
|
109
|
+
destinationList: TrelloCardWriteList;
|
|
110
|
+
}) | TrelloCardWriteFailure;
|
|
111
|
+
export type TrelloCardDeleteResult = (TrelloCardTargetReceipt & {
|
|
112
|
+
deletion: {
|
|
113
|
+
permanent: true;
|
|
114
|
+
};
|
|
115
|
+
}) | TrelloCardWriteFailure;
|
|
116
|
+
//#endregion
|
|
117
|
+
//# sourceMappingURL=trelloCardWrites.d.ts.map
|
|
File without changes
|
|
@@ -7,9 +7,9 @@ import { trace } from "../../../../utils/decorators/log.js";
|
|
|
7
7
|
import { PromiseCache } from "../../../../utils/promiseCache.js";
|
|
8
8
|
import __decorate from "../../../../_virtual/@oxc-project+runtime/helpers/esm/decorate.js";
|
|
9
9
|
import { AuthenticationError, RequestClientError, RequestNotFoundError, RequestRateLimitError, getDeferredRequestFailure, reportRequestFailure } from "../../../../git/errors.js";
|
|
10
|
-
import { sha256, uuid } from "../../../../utils/crypto.js";
|
|
11
10
|
import { maybeStopWatch } from "../../../../utils/stopwatch.js";
|
|
12
11
|
import { base64 } from "../../../../utils/base64.js";
|
|
12
|
+
import { sha256, uuid } from "../../../../utils/crypto.js";
|
|
13
13
|
import { effectiveIssueSort } from "../../../../git/utils/issue.utils.js";
|
|
14
14
|
import { ProviderFetchError, isRateLimitResponse, toRateLimitError } from "../../errors.js";
|
|
15
15
|
import { CommitReadRefusedError, isCommitReadRefusal, isNotFoundResponse, throwProviderError } from "../providerErrors.js";
|
|
@@ -18,8 +18,8 @@ import { decodePathSegment } from "../../utils/domain.utils.js";
|
|
|
18
18
|
import { azurePullRequestStatusToState, azureWorkItemsStateCategoryToState, encodeAzurePathSegment, fromAzurePullRequest, fromAzureWorkItem, getAzurePullRequestWebUrl, isClosedAzurePullRequestStatus, normalizeAzureBranchName, parseAzureWorkItemDate, sanitizeAzureRepositoryUrl } from "./models.js";
|
|
19
19
|
import { AzureWorkItemDescriptionsCache } from "./workItemDescriptions.js";
|
|
20
20
|
import { AzureWorkItemStatesCache, getAzureWorkItemTypeStatesPath, getAzureWorkItemTypesUrl, requireAzureWorkItemStateCategories, resolveAzureWorkItemStateCategory } from "./workItemStateCategories.js";
|
|
21
|
-
import { baseProviderApiConfig } from "../apiConfig.js";
|
|
22
21
|
import { createProviderApiRequest } from "../providerApiClient.js";
|
|
22
|
+
import { baseProviderApiConfig } from "../apiConfig.js";
|
|
23
23
|
import { queryAzureWorkItemSearch } from "./workItemSearch.js";
|
|
24
24
|
import * as l10n from "@vscode/l10n";
|
|
25
25
|
import { captureReadNodes, copyReadProvenance, createReadCapture } from "@gitkraken/provider-apis/read-provenance";
|
|
@@ -2,9 +2,9 @@ import { chunk } from "../../../utils/array.js";
|
|
|
2
2
|
import { isCancellationError } from "../../../utils/cancellation.js";
|
|
3
3
|
import { batch, mapBounded, mapSettledBounded } from "../../../utils/promise.js";
|
|
4
4
|
import { AuthenticationError, RequestNotFoundError } from "../../../git/errors.js";
|
|
5
|
-
import { uuid } from "../../../utils/crypto.js";
|
|
6
5
|
import { parseGitRemoteUrl } from "../../../git/utils/remote.utils.js";
|
|
7
6
|
import { getGitHubNoReplyAddressParts } from "../../../git/remotes/github.js";
|
|
7
|
+
import { uuid } from "../../../utils/crypto.js";
|
|
8
8
|
import "../../../git/models/pullRequest.js";
|
|
9
9
|
import { countGitHubStackMergedLayers, decodeGitHubCheckRunId, fromGitHubCheckContextState, fromGitHubIssueOrPullRequestState, fromGitHubMergeQueueEntryState, fromGitHubMergeQueueRemoval, fromGitHubPullRequestMergeableState, fromGitHubPullRequestReviewDecision, fromGitHubPullRequestStatusCheckRollupState, toGitHubCheckRunId } from "../../git-github/models.js";
|
|
10
10
|
import { IntegrationReadUnavailableError } from "../errors.js";
|
|
@@ -3,12 +3,13 @@ import { AutolinkReference, DynamicAutolinkReference } from "../../../git/models
|
|
|
3
3
|
import { IssueOrPullRequest, IssueOrPullRequestType } from "../../../git/models/issueOrPullRequest.js";
|
|
4
4
|
import { Issue, IssueShape } from "../../../git/models/issue.js";
|
|
5
5
|
import { Account } from "../../../git/models/author.js";
|
|
6
|
-
import { ConnectionResource, ProviderAuthenticationSession } from "../authentication/models.js";
|
|
6
|
+
import { ConfiguredIntegrationDescriptor, ConnectionResource, ProviderAuthenticationSession } from "../authentication/models.js";
|
|
7
7
|
import { IssuesCloudHostIntegrationId } from "../constants.js";
|
|
8
8
|
import { IntegrationAuthenticationProviderDescriptor } from "../authentication/integrationAuthenticationProvider.js";
|
|
9
9
|
import { IssueEtagFields } from "../reads/etag.js";
|
|
10
10
|
import { IntegrationResult } from "../models/publicIntegration.js";
|
|
11
11
|
import { AccountWideIssuesResult, IssuesForProjectOptions, ProjectIssuesDrain, ProjectIssuesRequest, SearchMyIssuesOptions } from "../models/issueReads.js";
|
|
12
|
+
import { LinearIssueWriteConnection } from "./linearIssueWriteTransport.js";
|
|
12
13
|
import { IssuesIntegration } from "../models/issuesIntegration.js";
|
|
13
14
|
import { ProviderApiCollectionResult, ProviderHierarchyResult, ProviderLinearProject } from "./models.js";
|
|
14
15
|
//#region ../plus/integrations/src/providers/linear.d.ts
|
|
@@ -20,6 +21,7 @@ export interface LinearOrganizationDescriptor extends IssueResourceDescriptor {
|
|
|
20
21
|
}
|
|
21
22
|
export interface LinearProjectDescriptor extends IssueResourceDescriptor {}
|
|
22
23
|
export declare class LinearIntegration extends IssuesIntegration<IssuesCloudHostIntegrationId.Linear> {
|
|
24
|
+
getIssueWriteConnection(connection: ConfiguredIntegrationDescriptor, isSelectionCurrent: () => boolean): Promise<LinearIssueWriteConnection | undefined>;
|
|
23
25
|
/**
|
|
24
26
|
* Built from the teams, so it follows them: rebuilt when the team list changes or the caches are dropped, and once
|
|
25
27
|
* {@link isAutolinkSetExpired}: older than the TTL, or than a shorter retry delay when the organization or the teams
|
|
@@ -164,11 +166,8 @@ export declare class LinearIntegration extends IssuesIntegration<IssuesCloudHost
|
|
|
164
166
|
* per issue. A request that throws rejects only its own targets' slots, with its error classified as the full
|
|
165
167
|
* read's would be.
|
|
166
168
|
*
|
|
167
|
-
*
|
|
168
|
-
*
|
|
169
|
-
* moved to another team), so an issue the query leaves out may still exist. Its target's slot is rejected, as is a
|
|
170
|
-
* target whose identifier isn't a team key and a number, so the full read decides. When no target was answered and
|
|
171
|
-
* nothing failed, the check declines instead, so a batch of only such targets costs a full read, not a failure.
|
|
169
|
+
* An explicitly trashed issue proves absence. A missing row cannot prove it because Linear's full point read can
|
|
170
|
+
* resolve an old identifier after a team rename or move.
|
|
172
171
|
*/
|
|
173
172
|
protected getProviderIssuesEtagFieldsByResourceId(session: ProviderAuthenticationSession, targets: readonly {
|
|
174
173
|
resourceId: string;
|
|
@@ -176,6 +175,7 @@ export declare class LinearIntegration extends IssuesIntegration<IssuesCloudHost
|
|
|
176
175
|
resourceUrl?: string;
|
|
177
176
|
}[]): Promise<PromiseSettledResult<IssueEtagFields | undefined>[] | undefined>;
|
|
178
177
|
private getRawProviderIssue;
|
|
178
|
+
private getVisibleProviderIssue;
|
|
179
179
|
private getIssueAutolinkLikeUrl;
|
|
180
180
|
}
|
|
181
181
|
//#endregion
|
|
@@ -63,6 +63,22 @@ function viewerScope(viewerId, filters) {
|
|
|
63
63
|
};
|
|
64
64
|
}
|
|
65
65
|
var LinearIntegration = class extends IssuesIntegration {
|
|
66
|
+
async getIssueWriteConnection(connection, isSelectionCurrent) {
|
|
67
|
+
if (!isSelectionCurrent()) return void 0;
|
|
68
|
+
const { id, cloud } = connection;
|
|
69
|
+
const session = await this.resolveReadSessionOrThrow(id, void 0, cloud);
|
|
70
|
+
if (session?.id !== id || session.cloud !== cloud || !session.accessToken) return void 0;
|
|
71
|
+
const tracked = this.trackWriteSession(session, {
|
|
72
|
+
cloud,
|
|
73
|
+
observeHostChanges: true
|
|
74
|
+
});
|
|
75
|
+
const isRetired = () => !isSelectionCurrent() || !this.isIntegrationAccessEnabled() || tracked.isRetired();
|
|
76
|
+
return {
|
|
77
|
+
session,
|
|
78
|
+
isCurrent: tracked,
|
|
79
|
+
isRetired
|
|
80
|
+
};
|
|
81
|
+
}
|
|
66
82
|
/**
|
|
67
83
|
* Built from the teams, so it follows them: rebuilt when the team list changes or the caches are dropped, and once
|
|
68
84
|
* {@link isAutolinkSetExpired}: older than the TTL, or than a shorter retry delay when the organization or the teams
|
|
@@ -599,10 +615,7 @@ var LinearIntegration = class extends IssuesIntegration {
|
|
|
599
615
|
return result && fromProviderIssue(result, this, { projection: "point" });
|
|
600
616
|
}
|
|
601
617
|
async getProviderIssueByResourceId(session, resourceId, id, _resourceUrl) {
|
|
602
|
-
const result = await
|
|
603
|
-
resourceId,
|
|
604
|
-
number: id
|
|
605
|
-
});
|
|
618
|
+
const result = await this.getVisibleProviderIssue(session, resourceId, id);
|
|
606
619
|
return result && fromProviderIssue(result, this, { projection: "batch" });
|
|
607
620
|
}
|
|
608
621
|
/**
|
|
@@ -611,11 +624,8 @@ var LinearIntegration = class extends IssuesIntegration {
|
|
|
611
624
|
* per issue. A request that throws rejects only its own targets' slots, with its error classified as the full
|
|
612
625
|
* read's would be.
|
|
613
626
|
*
|
|
614
|
-
*
|
|
615
|
-
*
|
|
616
|
-
* moved to another team), so an issue the query leaves out may still exist. Its target's slot is rejected, as is a
|
|
617
|
-
* target whose identifier isn't a team key and a number, so the full read decides. When no target was answered and
|
|
618
|
-
* nothing failed, the check declines instead, so a batch of only such targets costs a full read, not a failure.
|
|
627
|
+
* An explicitly trashed issue proves absence. A missing row cannot prove it because Linear's full point read can
|
|
628
|
+
* resolve an old identifier after a team rename or move.
|
|
619
629
|
*/
|
|
620
630
|
async getProviderIssuesEtagFieldsByResourceId(session, targets) {
|
|
621
631
|
const slots = new Array(targets.length);
|
|
@@ -669,11 +679,17 @@ var LinearIntegration = class extends IssuesIntegration {
|
|
|
669
679
|
for (const [number, indices] of entries) {
|
|
670
680
|
const issue = byNumber.get(number);
|
|
671
681
|
let slot;
|
|
672
|
-
if (issue
|
|
682
|
+
if (typeof issue?.identifier !== "string" || issue.identifier.toUpperCase() !== `${teamKey}-${number}`) slot = {
|
|
673
683
|
status: "rejected",
|
|
674
684
|
reason: /* @__PURE__ */ new Error(`Linear did not return ${teamKey}-${number}`)
|
|
675
685
|
};
|
|
676
|
-
else
|
|
686
|
+
else if (issue.trashed === true) {
|
|
687
|
+
slot = {
|
|
688
|
+
status: "fulfilled",
|
|
689
|
+
value: void 0
|
|
690
|
+
};
|
|
691
|
+
answered = true;
|
|
692
|
+
} else try {
|
|
677
693
|
slot = {
|
|
678
694
|
status: "fulfilled",
|
|
679
695
|
value: toLinearIssueEtagFields(issue)
|
|
@@ -693,15 +709,21 @@ var LinearIntegration = class extends IssuesIntegration {
|
|
|
693
709
|
return answered || failed ? slots : void 0;
|
|
694
710
|
}
|
|
695
711
|
async getRawProviderIssue(session, resource, id) {
|
|
696
|
-
const api = await this.getProvidersApi();
|
|
697
712
|
if (!isIssueResourceDescriptor(resource)) {
|
|
698
713
|
_logger.error(void 0, "getProviderIssue: resource is not an IssueResourceDescriptor");
|
|
699
714
|
return;
|
|
700
715
|
}
|
|
701
|
-
return
|
|
702
|
-
|
|
716
|
+
return this.getVisibleProviderIssue(session, resource.id, id);
|
|
717
|
+
}
|
|
718
|
+
async getVisibleProviderIssue(session, resourceId, id) {
|
|
719
|
+
const api = await this.getProvidersApi();
|
|
720
|
+
const token = toTokenWithInfo(this.id, session);
|
|
721
|
+
const issue = await api.getIssue(token, {
|
|
722
|
+
resourceId,
|
|
703
723
|
number: id
|
|
704
724
|
});
|
|
725
|
+
if (issue?.closedDate != null && await api.getLinearIssueTrashed(token, issue.id)) return void 0;
|
|
726
|
+
return issue;
|
|
705
727
|
}
|
|
706
728
|
getIssueAutolinkLikeUrl(issue) {
|
|
707
729
|
const url = issue.url;
|