@gitkraken/core-gitlens 0.64.0 → 0.65.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 +18 -1
- package/dist/git/watching/provider.d.ts +1 -1
- package/dist/git/watching/watchService.js +6 -1
- package/dist/git/watching/watchService.js.map +1 -1
- package/dist/git-cli/cliGitProvider.js +3 -3
- package/dist/git-cli/cliGitProvider.js.map +1 -1
- package/dist/plus/integrations/extensionManager.js.map +1 -1
- package/dist/plus/integrations/index.js +5 -1
- package/dist/plus/integrations/index.js.map +1 -1
- package/dist/plus/integrations/integrationService.d.ts +8 -4
- package/dist/plus/integrations/integrationService.js +23 -22
- package/dist/plus/integrations/integrationService.js.map +1 -1
- package/dist/plus/integrations/models/gitlabIssueWrites.d.ts +12 -5
- package/dist/plus/integrations/models/gitlabIssueWrites.js.map +1 -1
- package/dist/plus/integrations/models/gitlabMergeRequestWrites.d.ts +4 -1
- package/dist/plus/integrations/providers/gitlab/issueDelete.d.ts +11 -0
- package/dist/plus/integrations/providers/gitlab/issueDelete.js +132 -0
- package/dist/plus/integrations/providers/gitlab/issueDelete.js.map +1 -0
- package/dist/plus/integrations/providers/gitlab/issueWrites.d.ts +2 -1
- package/dist/plus/integrations/providers/gitlab/issueWrites.js +77 -33
- package/dist/plus/integrations/providers/gitlab/issueWrites.js.map +1 -1
- package/dist/plus/integrations/providers/gitlab/mergeRequestWrites.d.ts +1 -0
- package/dist/plus/integrations/providers/gitlab/mergeRequestWrites.js +7 -2
- package/dist/plus/integrations/providers/gitlab/mergeRequestWrites.js.map +1 -1
- package/dist/plus/integrations/providers/gitlab/writeTransport.d.ts +11 -0
- package/dist/plus/integrations/providers/gitlab/writeTransport.js +50 -10
- package/dist/plus/integrations/providers/gitlab/writeTransport.js.map +1 -1
- package/dist/plus/integrations/providers/gitlab.d.ts +4 -9
- package/dist/plus/integrations/providers/gitlab.js +29 -29
- package/dist/plus/integrations/providers/gitlab.js.map +1 -1
- package/docs/integrations.md +14 -4
- package/package.json +1 -1
|
@@ -36,6 +36,7 @@ import { ApiClients } from "./providers/apiClients.js";
|
|
|
36
36
|
import { AzureDevOpsIntegration } from "./providers/azureDevOps.js";
|
|
37
37
|
import { BitbucketIntegration } from "./providers/bitbucket.js";
|
|
38
38
|
import { GitHubEnterpriseIntegration, GitHubIntegration } from "./providers/github.js";
|
|
39
|
+
import { GitLabIssueWriter } from "./providers/gitlab/issueWrites.js";
|
|
39
40
|
import { GitLabMergeRequestWriter } from "./providers/gitlab/mergeRequestWrites.js";
|
|
40
41
|
import { RepositoryResolutionContext } from "./reads/context.js";
|
|
41
42
|
import { IntegrationAuthenticationService } from "./authentication/integrationAuthenticationService.js";
|
|
@@ -44,12 +45,15 @@ import { IntegrationAuthenticationService } from "./authentication/integrationAu
|
|
|
44
45
|
export interface IntegrationConnectionChangeEvent extends ConnectionStateChangeEvent {
|
|
45
46
|
integration: IntegrationBase;
|
|
46
47
|
}
|
|
47
|
-
|
|
48
|
+
type GitLabWriterFactories = {
|
|
49
|
+
issue: (transport: GitLabWriteTransport) => GitLabIssueWriter;
|
|
50
|
+
mergeRequest: (transport: GitLabWriteTransport) => GitLabMergeRequestWriter;
|
|
51
|
+
};
|
|
48
52
|
export declare class IntegrationService implements Disposable, IntegrationManager, RepositoryResolutionContext {
|
|
49
53
|
private readonly authenticationService;
|
|
50
54
|
private readonly configuredIntegrationService;
|
|
51
55
|
private readonly ctx;
|
|
52
|
-
private readonly
|
|
56
|
+
private readonly gitLabWriters?;
|
|
53
57
|
get onDidChange(): Event<ConfiguredIntegrationsChangeEvent>;
|
|
54
58
|
private readonly _onDidChangeConnectionState;
|
|
55
59
|
get onDidChangeConnectionState(): Event<ConnectionStateChangeEvent>;
|
|
@@ -64,7 +68,7 @@ export declare class IntegrationService implements Disposable, IntegrationManage
|
|
|
64
68
|
get apis(): ApiClients;
|
|
65
69
|
/** The shared `GitHubApi` instance — also consumed by the host's GitHub git provider (one instance). */
|
|
66
70
|
get github(): Promise<GitHubApi | undefined>;
|
|
67
|
-
constructor(authenticationService: IntegrationAuthenticationService, configuredIntegrationService: ConfiguredIntegrationService, ctx: IntegrationServiceContext,
|
|
71
|
+
constructor(authenticationService: IntegrationAuthenticationService, configuredIntegrationService: ConfiguredIntegrationService, ctx: IntegrationServiceContext, gitLabWriters?: GitLabWriterFactories | undefined);
|
|
68
72
|
dispose(): void;
|
|
69
73
|
connectCloudIntegrations(options?: {
|
|
70
74
|
integrationIds: SupportedCloudIntegrationIds[];
|
|
@@ -699,6 +703,6 @@ export declare class IntegrationService implements Disposable, IntegrationManage
|
|
|
699
703
|
refreshConnections(): Promise<void>;
|
|
700
704
|
}
|
|
701
705
|
/** Internal factory used by the GitLens host and integration tests that need the full service surface. */
|
|
702
|
-
export declare function createIntegrationService(ctx: IntegrationServiceContext,
|
|
706
|
+
export declare function createIntegrationService(ctx: IntegrationServiceContext, gitLabWriters?: GitLabWriterFactories): IntegrationService;
|
|
703
707
|
//#endregion
|
|
704
708
|
//# sourceMappingURL=integrationService.d.ts.map
|
|
@@ -13,7 +13,7 @@ import { GitCloudHostIntegrationId, GitSelfManagedHostIntegrationId, IssuesCloud
|
|
|
13
13
|
import "./providers/utils/providerPaging.js";
|
|
14
14
|
import { providersMetadata } from "./providers/metadata.js";
|
|
15
15
|
import { areDomainsOnSameHost, baseUrlFromDomain, getRemoteHostMatcher, hostFromDomain, matchesInstallationOrigin, sameConfiguredBaseUrl } from "./utils/domain.utils.js";
|
|
16
|
-
import { convertRemoteProviderIdToIntegrationId, getGitHubEnterprisePullRequestWriteOrigin, getIntegrationIdForRemote, isCloudSelfManagedHostIntegrationId, isGitCloudHostIntegrationId, isGitSelfManagedHostIntegrationId, isNonExpiringZeroTokenIntegrationId, isSelfManagedHostIntegrationId, remoteProviderTypeForConfig, remoteProviderTypeForIntegration } from "./utils/integration.utils.js";
|
|
16
|
+
import { convertRemoteProviderIdToIntegrationId, getGitHubEnterprisePullRequestWriteOrigin, getIntegrationIdForRemote, getSelfManagedBaseUrl, isCloudSelfManagedHostIntegrationId, isGitCloudHostIntegrationId, isGitSelfManagedHostIntegrationId, isNonExpiringZeroTokenIntegrationId, isSelfManagedHostIntegrationId, remoteProviderTypeForConfig, remoteProviderTypeForIntegration } from "./utils/integration.utils.js";
|
|
17
17
|
import { getSupportedCloudIntegrationIds, isSupportedCloudIntegrationId, toIntegrationId } from "./authentication/models.js";
|
|
18
18
|
import { CloudIntegrationService } from "./authentication/cloudIntegrationService.js";
|
|
19
19
|
import { ConfiguredIntegrationService } from "./authentication/configuredIntegrationService.js";
|
|
@@ -57,7 +57,7 @@ var IntegrationService = class {
|
|
|
57
57
|
authenticationService;
|
|
58
58
|
configuredIntegrationService;
|
|
59
59
|
ctx;
|
|
60
|
-
|
|
60
|
+
gitLabWriters;
|
|
61
61
|
get onDidChange() {
|
|
62
62
|
return this.configuredIntegrationService.onDidChange;
|
|
63
63
|
}
|
|
@@ -80,11 +80,11 @@ var IntegrationService = class {
|
|
|
80
80
|
get github() {
|
|
81
81
|
return this.apis.github;
|
|
82
82
|
}
|
|
83
|
-
constructor(authenticationService, configuredIntegrationService, ctx,
|
|
83
|
+
constructor(authenticationService, configuredIntegrationService, ctx, gitLabWriters) {
|
|
84
84
|
this.authenticationService = authenticationService;
|
|
85
85
|
this.configuredIntegrationService = configuredIntegrationService;
|
|
86
86
|
this.ctx = ctx;
|
|
87
|
-
this.
|
|
87
|
+
this.gitLabWriters = gitLabWriters;
|
|
88
88
|
this._disposable = fromDisposables(configuredIntegrationService.onWillChangeSession(({ integrationId, session, previousDomain }) => {
|
|
89
89
|
this.onSessionPublishing(integrationId, { session }, [session.domain, previousDomain]);
|
|
90
90
|
}), configuredIntegrationService.onWillRemoveSessions(({ integrationId, connectionId, cloud, domain }) => {
|
|
@@ -1008,7 +1008,7 @@ var IntegrationService = class {
|
|
|
1008
1008
|
return this.withGitLabIssueWriter(input, "write", (writer) => writer.delete(input));
|
|
1009
1009
|
}
|
|
1010
1010
|
withGitLabIssueWriter(scope, access, run) {
|
|
1011
|
-
return this.withGitLabWriter(scope, access,
|
|
1011
|
+
return this.withGitLabWriter(scope, access, this.gitLabWriters?.issue, run);
|
|
1012
1012
|
}
|
|
1013
1013
|
getGitLabMergeRequestCreateOptions(options) {
|
|
1014
1014
|
const input = { ...options };
|
|
@@ -1031,25 +1031,26 @@ var IntegrationService = class {
|
|
|
1031
1031
|
return this.withGitLabMergeRequestWriter(input, "write", (writer) => writer.delete(input));
|
|
1032
1032
|
}
|
|
1033
1033
|
async withGitLabMergeRequestWriter(scope, access, run) {
|
|
1034
|
-
const create = this.createGitLabMergeRequestWriter;
|
|
1035
|
-
if (create == null) return gitLabWriteFailure("unsupported");
|
|
1036
|
-
return this.withGitLabWriter(scope, access, async (integration, connection, isSelectionCurrent) => {
|
|
1037
|
-
const selected = await integration.getWriteTransport(scope, connection, isSelectionCurrent);
|
|
1038
|
-
return selected && {
|
|
1039
|
-
writer: create(selected.transport),
|
|
1040
|
-
isCurrent: selected.isCurrent
|
|
1041
|
-
};
|
|
1042
|
-
}, run);
|
|
1043
|
-
}
|
|
1044
|
-
async withGitLabWriter(scope, access, select, run) {
|
|
1045
1034
|
if (scope.providerId !== "gitlab") return gitLabWriteFailure("unsupported");
|
|
1046
|
-
|
|
1035
|
+
return this.withGitLabWriter(scope, access, this.gitLabWriters?.mergeRequest, run);
|
|
1036
|
+
}
|
|
1037
|
+
async withGitLabWriter(scope, access, create, run) {
|
|
1038
|
+
if (create == null) return gitLabWriteFailure("unsupported");
|
|
1039
|
+
const providerId = scope.providerId;
|
|
1040
|
+
if (providerId !== "gitlab" && providerId !== "cloud-gitlab-self-hosted") return gitLabWriteFailure("unsupported");
|
|
1041
|
+
const baseUrl = typeof scope.baseUrl === "string" ? scope.baseUrl : "";
|
|
1042
|
+
const selfManaged = providerId === "cloud-gitlab-self-hosted";
|
|
1043
|
+
if (typeof scope.connectionId !== "string" || !scope.connectionId || scope.connectionId.trim() !== scope.connectionId || (selfManaged ? !matchesInstallationOrigin(baseUrl, baseUrl) || baseUrl !== getSelfManagedBaseUrl(providerId, baseUrl) || hostFromDomain(baseUrl) === "gitlab.com" : baseUrl !== "https://gitlab.com") || scope.expectedAccountId !== void 0 && !isGitLabDecimalId(scope.expectedAccountId)) return gitLabWriteFailure("invalid-input");
|
|
1047
1044
|
try {
|
|
1048
|
-
const selection = await this.configuredIntegrationService.captureConnectionSelection(
|
|
1045
|
+
const selection = await this.configuredIntegrationService.captureConnectionSelection(providerId, scope.connectionId);
|
|
1049
1046
|
if (!selection?.isCurrent()) return gitLabWriteFailure("no-connection");
|
|
1050
|
-
const
|
|
1047
|
+
const domain = selection.connection.domain;
|
|
1048
|
+
if (selfManaged && (!domain || !matchesInstallationOrigin(domain, baseUrl))) return gitLabWriteFailure("no-connection");
|
|
1049
|
+
const integration = await this.get(providerId, domain);
|
|
1050
|
+
if (integration == null) return gitLabWriteFailure("no-connection");
|
|
1051
|
+
const selected = await integration.getWriteTransport(scope, selection.connection, selection.isCurrent);
|
|
1051
1052
|
if (selected == null) return gitLabWriteFailure("no-connection");
|
|
1052
|
-
const result = await run(selected.
|
|
1053
|
+
const result = await run(create(selected.transport));
|
|
1053
1054
|
return access === "read" && !await selected.isCurrent() ? gitLabWriteFailure("no-connection") : result;
|
|
1054
1055
|
} catch (ex) {
|
|
1055
1056
|
return toGitLabPreflightFailure(ex);
|
|
@@ -1807,11 +1808,11 @@ __decorate([debug()], IntegrationService.prototype, "reset", null);
|
|
|
1807
1808
|
__decorate([gate()], IntegrationService.prototype, "queueCloudSync", null);
|
|
1808
1809
|
__decorate([trace()], IntegrationService.prototype, "syncCloudIntegrationsCore", null);
|
|
1809
1810
|
/** Internal factory used by the GitLens host and integration tests that need the full service surface. */
|
|
1810
|
-
function createIntegrationService(ctx,
|
|
1811
|
+
function createIntegrationService(ctx, gitLabWriters) {
|
|
1811
1812
|
const configured = new ConfiguredIntegrationService(ctx);
|
|
1812
1813
|
const cloud = new CloudIntegrationService(ctx);
|
|
1813
1814
|
let service;
|
|
1814
|
-
service = new IntegrationService(new IntegrationAuthenticationService(configured, ctx, () => service, cloud), configured, ctx,
|
|
1815
|
+
service = new IntegrationService(new IntegrationAuthenticationService(configured, ctx, () => service, cloud), configured, ctx, gitLabWriters);
|
|
1815
1816
|
purgeRetiredIntegrationStorage(ctx, configured);
|
|
1816
1817
|
purgeJiraDiscoveryStorage(ctx);
|
|
1817
1818
|
return service;
|