@gitkraken/core-gitlens 0.45.0 → 0.47.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.
Files changed (261) hide show
  1. package/CHANGELOG.md +35 -1
  2. package/dist/git/models/remote.js +2 -2
  3. package/dist/git/models/remote.js.map +1 -1
  4. package/dist/git/remotes/matcher.js +25 -3
  5. package/dist/git/remotes/matcher.js.map +1 -1
  6. package/dist/git/utils/branchLanded.utils.d.ts +7 -0
  7. package/dist/git/utils/branchLanded.utils.js +10 -1
  8. package/dist/git/utils/branchLanded.utils.js.map +1 -1
  9. package/dist/git/utils/remote.utils.d.ts +1 -0
  10. package/dist/git/utils/remote.utils.js +14 -5
  11. package/dist/git/utils/remote.utils.js.map +1 -1
  12. package/dist/git-cli/parsers/logParser.js +227 -468
  13. package/dist/git-cli/parsers/logParser.js.map +1 -1
  14. package/dist/git-cli/parsers/refParser.js +4 -4
  15. package/dist/git-cli/parsers/refParser.js.map +1 -1
  16. package/dist/git-cli/providers/branches.d.ts +5 -0
  17. package/dist/git-cli/providers/branches.js +25 -21
  18. package/dist/git-cli/providers/branches.js.map +1 -1
  19. package/dist/git-cli/providers/config.js +2 -2
  20. package/dist/git-cli/providers/pausedOperations.js +2 -2
  21. package/dist/git-cli/providers/pausedOperations.js.map +1 -1
  22. package/dist/git-cli/providers/staging.js +1 -1
  23. package/dist/ipc/discovery.js +1 -1
  24. package/dist/plus/agents/providers/claudeCodeTranscript.js +6 -6
  25. package/dist/plus/agents/providers/claudeCodeTranscript.js.map +1 -1
  26. package/dist/plus/ai/providers/openAICompatibleProviderBase.js +1 -1
  27. package/dist/plus/git-github/api/enterprisePullRequestMergePolicy.d.ts +31 -0
  28. package/dist/plus/git-github/api/enterprisePullRequestMergePolicy.js +166 -0
  29. package/dist/plus/git-github/api/enterprisePullRequestMergePolicy.js.map +1 -0
  30. package/dist/plus/git-github/api/github.d.ts +13 -5
  31. package/dist/plus/git-github/api/github.js +53 -13
  32. package/dist/plus/git-github/api/github.js.map +1 -1
  33. package/dist/plus/git-github/api/issueWrites.d.ts +7 -1
  34. package/dist/plus/git-github/api/issueWrites.js +62 -32
  35. package/dist/plus/git-github/api/issueWrites.js.map +1 -1
  36. package/dist/plus/git-github/api/pullRequestWrites.d.ts +7 -3
  37. package/dist/plus/git-github/api/pullRequestWrites.js +120 -67
  38. package/dist/plus/git-github/api/pullRequestWrites.js.map +1 -1
  39. package/dist/plus/integrations/authentication/cloudIntegrationAuthenticationProvider.d.ts +44 -0
  40. package/dist/plus/integrations/authentication/cloudIntegrationAuthenticationProvider.js +199 -0
  41. package/dist/plus/integrations/authentication/cloudIntegrationAuthenticationProvider.js.map +1 -0
  42. package/dist/plus/integrations/authentication/configuredIntegrationService.d.ts +7 -0
  43. package/dist/plus/integrations/authentication/configuredIntegrationService.js +53 -7
  44. package/dist/plus/integrations/authentication/configuredIntegrationService.js.map +1 -1
  45. package/dist/plus/integrations/authentication/integrationAuthenticationProvider.d.ts +2 -38
  46. package/dist/plus/integrations/authentication/integrationAuthenticationProvider.js +0 -199
  47. package/dist/plus/integrations/authentication/integrationAuthenticationService.d.ts +4 -2
  48. package/dist/plus/integrations/authentication/integrationAuthenticationService.js +12 -1
  49. package/dist/plus/integrations/authentication/integrationAuthenticationService.js.map +1 -1
  50. package/dist/plus/integrations/authentication/models.d.ts +0 -1
  51. package/dist/plus/integrations/authentication/models.js +1 -2
  52. package/dist/plus/integrations/authentication/models.js.map +1 -1
  53. package/dist/plus/integrations/constants.d.ts +0 -10
  54. package/dist/plus/integrations/constants.js +1 -95
  55. package/dist/plus/integrations/constants.js.map +1 -1
  56. package/dist/plus/integrations/context.d.ts +17 -17
  57. package/dist/plus/integrations/index.d.ts +44 -25
  58. package/dist/plus/integrations/index.js +41 -8
  59. package/dist/plus/integrations/index.js.map +1 -1
  60. package/dist/plus/integrations/integrationService.d.ts +24 -24
  61. package/dist/plus/integrations/integrationService.js +125 -34
  62. package/dist/plus/integrations/integrationService.js.map +1 -1
  63. package/dist/plus/integrations/lite.js +1 -1
  64. package/dist/plus/integrations/lite.js.map +1 -1
  65. package/dist/plus/integrations/manager.d.ts +81 -21
  66. package/dist/plus/integrations/models/actionablePullRequest.d.ts +213 -0
  67. package/dist/plus/integrations/models/actionablePullRequest.js +25 -0
  68. package/dist/plus/integrations/models/actionablePullRequest.js.map +1 -0
  69. package/dist/plus/integrations/models/gitHostIntegration.d.ts +13 -46
  70. package/dist/plus/integrations/models/gitHostIntegration.js +22 -8
  71. package/dist/plus/integrations/models/gitHostIntegration.js.map +1 -1
  72. package/dist/plus/integrations/models/integration.d.ts +11 -175
  73. package/dist/plus/integrations/models/integration.js +22 -76
  74. package/dist/plus/integrations/models/integration.js.map +1 -1
  75. package/dist/plus/integrations/models/issueTrackerWrites.d.ts +128 -0
  76. package/dist/plus/integrations/models/issueTrackerWrites.js +0 -0
  77. package/dist/plus/integrations/models/issuesIntegration.d.ts +9 -5
  78. package/dist/plus/integrations/models/issuesIntegration.js +5 -3
  79. package/dist/plus/integrations/models/issuesIntegration.js.map +1 -1
  80. package/dist/plus/integrations/models/publicIntegration.d.ts +257 -0
  81. package/dist/plus/integrations/models/publicIntegration.js +21 -0
  82. package/dist/plus/integrations/models/publicIntegration.js.map +1 -0
  83. package/dist/plus/integrations/providerFilters.d.ts +58 -0
  84. package/dist/plus/integrations/providerFilters.js.map +1 -1
  85. package/dist/plus/integrations/providers/actionablePullRequests.d.ts +19 -0
  86. package/dist/plus/integrations/providers/actionablePullRequests.js +32 -0
  87. package/dist/plus/integrations/providers/actionablePullRequests.js.map +1 -0
  88. package/dist/plus/integrations/providers/apiClients.d.ts +1 -2
  89. package/dist/plus/integrations/providers/apiClients.js.map +1 -1
  90. package/dist/plus/integrations/providers/asana.d.ts +3 -2
  91. package/dist/plus/integrations/providers/asana.js +2 -1
  92. package/dist/plus/integrations/providers/asana.js.map +1 -1
  93. package/dist/plus/integrations/providers/azure/azure.d.ts +1 -1
  94. package/dist/plus/integrations/providers/azure/azure.js +1 -1
  95. package/dist/plus/integrations/providers/azure/azure.utils.d.ts +10 -3
  96. package/dist/plus/integrations/providers/azure/azure.utils.js +5 -1
  97. package/dist/plus/integrations/providers/azure/azure.utils.js.map +1 -1
  98. package/dist/plus/integrations/providers/azure/models.d.ts +1 -5
  99. package/dist/plus/integrations/providers/azure/models.js +1 -1
  100. package/dist/plus/integrations/providers/azure/models.js.map +1 -1
  101. package/dist/plus/integrations/providers/azureDevOps.d.ts +8 -5
  102. package/dist/plus/integrations/providers/azureDevOps.js +2 -1
  103. package/dist/plus/integrations/providers/azureDevOps.js.map +1 -1
  104. package/dist/plus/integrations/providers/azureDevOpsServer.d.ts +5 -4
  105. package/dist/plus/integrations/providers/azureDevOpsServer.js +3 -1
  106. package/dist/plus/integrations/providers/azureDevOpsServer.js.map +1 -1
  107. package/dist/plus/integrations/providers/bitbucket/bitbucket.d.ts +2 -2
  108. package/dist/plus/integrations/providers/bitbucket/bitbucket.js.map +1 -1
  109. package/dist/plus/integrations/providers/bitbucket/models.d.ts +1 -1
  110. package/dist/plus/integrations/providers/bitbucket/models.js.map +1 -1
  111. package/dist/plus/integrations/providers/bitbucket-server.d.ts +5 -4
  112. package/dist/plus/integrations/providers/bitbucket-server.js +2 -1
  113. package/dist/plus/integrations/providers/bitbucket-server.js.map +1 -1
  114. package/dist/plus/integrations/providers/bitbucket.d.ts +4 -3
  115. package/dist/plus/integrations/providers/bitbucket.js +2 -1
  116. package/dist/plus/integrations/providers/bitbucket.js.map +1 -1
  117. package/dist/plus/integrations/providers/github/github.d.ts +0 -1
  118. package/dist/plus/integrations/providers/github/github.js +1 -1
  119. package/dist/plus/integrations/providers/github/github.js.map +1 -1
  120. package/dist/plus/integrations/providers/github.d.ts +29 -11
  121. package/dist/plus/integrations/providers/github.js +195 -78
  122. package/dist/plus/integrations/providers/github.js.map +1 -1
  123. package/dist/plus/integrations/providers/gitlab/gitlab.d.ts +2 -2
  124. package/dist/plus/integrations/providers/gitlab/gitlab.js +1 -2
  125. package/dist/plus/integrations/providers/gitlab/gitlab.js.map +1 -1
  126. package/dist/plus/integrations/providers/gitlab/gitlab.utils.d.ts +14 -1
  127. package/dist/plus/integrations/providers/gitlab/gitlab.utils.js.map +1 -1
  128. package/dist/plus/integrations/providers/gitlab/models.d.ts +2 -10
  129. package/dist/plus/integrations/providers/gitlab/models.js.map +1 -1
  130. package/dist/plus/integrations/providers/gitlab.d.ts +7 -5
  131. package/dist/plus/integrations/providers/gitlab.js +2 -1
  132. package/dist/plus/integrations/providers/gitlab.js.map +1 -1
  133. package/dist/plus/integrations/providers/issueSorts.d.ts +1 -0
  134. package/dist/plus/integrations/providers/jira-server.d.ts +4 -4
  135. package/dist/plus/integrations/providers/jira-server.js +3 -2
  136. package/dist/plus/integrations/providers/jira-server.js.map +1 -1
  137. package/dist/plus/integrations/providers/jira.d.ts +3 -3
  138. package/dist/plus/integrations/providers/jira.js +4 -3
  139. package/dist/plus/integrations/providers/jira.js.map +1 -1
  140. package/dist/plus/integrations/providers/jiraIssueByKey.d.ts +3 -1
  141. package/dist/plus/integrations/providers/jiraIssueByKey.js +1 -1
  142. package/dist/plus/integrations/providers/jiraIssueByKey.js.map +1 -1
  143. package/dist/plus/integrations/providers/jiraIssueWriteErrors.d.ts +10 -0
  144. package/dist/plus/integrations/providers/jiraIssueWriteErrors.js +68 -0
  145. package/dist/plus/integrations/providers/jiraIssueWriteErrors.js.map +1 -0
  146. package/dist/plus/integrations/providers/jiraIssueWrites.d.ts +40 -0
  147. package/dist/plus/integrations/providers/jiraIssueWrites.js +397 -0
  148. package/dist/plus/integrations/providers/jiraIssueWrites.js.map +1 -0
  149. package/dist/plus/integrations/providers/linear.d.ts +4 -3
  150. package/dist/plus/integrations/providers/linear.js +3 -2
  151. package/dist/plus/integrations/providers/linear.js.map +1 -1
  152. package/dist/plus/integrations/providers/linearIssuesEtag.d.ts +1 -1
  153. package/dist/plus/integrations/providers/linearIssuesEtag.js +1 -1
  154. package/dist/plus/integrations/providers/linearIssuesEtag.js.map +1 -1
  155. package/dist/plus/integrations/providers/metadata.d.ts +136 -0
  156. package/dist/plus/integrations/providers/metadata.js +513 -0
  157. package/dist/plus/integrations/providers/metadata.js.map +1 -0
  158. package/dist/plus/integrations/providers/models.d.ts +10 -206
  159. package/dist/plus/integrations/providers/models.js +8 -539
  160. package/dist/plus/integrations/providers/models.js.map +1 -1
  161. package/dist/plus/integrations/providers/providersApi.d.ts +7 -3
  162. package/dist/plus/integrations/providers/providersApi.js +23 -11
  163. package/dist/plus/integrations/providers/providersApi.js.map +1 -1
  164. package/dist/plus/integrations/providers/trello.d.ts +1 -1
  165. package/dist/plus/integrations/providers/trello.js +2 -1
  166. package/dist/plus/integrations/providers/trello.js.map +1 -1
  167. package/dist/plus/integrations/providers/utils/providerPaging.d.ts +2 -0
  168. package/dist/plus/integrations/providers/utils/providerPaging.js +3 -2
  169. package/dist/plus/integrations/providers/utils/providerPaging.js.map +1 -1
  170. package/dist/plus/integrations/providers/utils.d.ts +119 -10
  171. package/dist/plus/integrations/providers/utils.js +57 -3
  172. package/dist/plus/integrations/providers/utils.js.map +1 -1
  173. package/dist/plus/integrations/reads/autolinks.d.ts +1 -1
  174. package/dist/plus/integrations/reads/autolinks.js +1 -1
  175. package/dist/plus/integrations/reads/autolinks.js.map +1 -1
  176. package/dist/plus/integrations/reads/broaden.d.ts +1 -1
  177. package/dist/plus/integrations/reads/broaden.js +3 -2
  178. package/dist/plus/integrations/reads/broaden.js.map +1 -1
  179. package/dist/plus/integrations/reads/context.d.ts +1 -1
  180. package/dist/plus/integrations/reads/counts.d.ts +1 -88
  181. package/dist/plus/integrations/reads/counts.js +4 -2
  182. package/dist/plus/integrations/reads/counts.js.map +1 -1
  183. package/dist/plus/integrations/reads/currentAccount.d.ts +1 -18
  184. package/dist/plus/integrations/reads/currentAccount.js.map +1 -1
  185. package/dist/plus/integrations/reads/drains.d.ts +4 -3
  186. package/dist/plus/integrations/reads/drains.js +1 -1
  187. package/dist/plus/integrations/reads/drains.js.map +1 -1
  188. package/dist/plus/integrations/reads/etag.d.ts +174 -3
  189. package/dist/plus/integrations/reads/etag.js +69 -14
  190. package/dist/plus/integrations/reads/etag.js.map +1 -1
  191. package/dist/plus/integrations/reads/filters.d.ts +3 -61
  192. package/dist/plus/integrations/reads/filters.js +1 -1
  193. package/dist/plus/integrations/reads/filters.js.map +1 -1
  194. package/dist/plus/integrations/reads/hierarchy.d.ts +1 -1
  195. package/dist/plus/integrations/reads/hierarchy.js +4 -2
  196. package/dist/plus/integrations/reads/hierarchy.js.map +1 -1
  197. package/dist/plus/integrations/reads/issueBatch.d.ts +2 -102
  198. package/dist/plus/integrations/reads/issueBatch.js +3 -4
  199. package/dist/plus/integrations/reads/issueBatch.js.map +1 -1
  200. package/dist/plus/integrations/reads/issueTracker.d.ts +1 -1
  201. package/dist/plus/integrations/reads/issueTracker.js +4 -3
  202. package/dist/plus/integrations/reads/issueTracker.js.map +1 -1
  203. package/dist/plus/integrations/reads/issues.d.ts +1 -1
  204. package/dist/plus/integrations/reads/issues.js +4 -2
  205. package/dist/plus/integrations/reads/issues.js.map +1 -1
  206. package/dist/plus/integrations/reads/paging.d.ts +1 -1
  207. package/dist/plus/integrations/reads/paging.js +1 -1
  208. package/dist/plus/integrations/reads/paging.js.map +1 -1
  209. package/dist/plus/integrations/reads/pullRequestActivity.d.ts +1 -24
  210. package/dist/plus/integrations/reads/pullRequestActivity.js +2 -1
  211. package/dist/plus/integrations/reads/pullRequestActivity.js.map +1 -1
  212. package/dist/plus/integrations/reads/pullRequestBatch.d.ts +2 -56
  213. package/dist/plus/integrations/reads/pullRequestBatch.js +23 -3
  214. package/dist/plus/integrations/reads/pullRequestBatch.js.map +1 -1
  215. package/dist/plus/integrations/reads/pullRequestBranches.d.ts +1 -47
  216. package/dist/plus/integrations/reads/pullRequestBranches.js +2 -1
  217. package/dist/plus/integrations/reads/pullRequestBranches.js.map +1 -1
  218. package/dist/plus/integrations/reads/pullRequestCheckLogs.d.ts +1 -15
  219. package/dist/plus/integrations/reads/pullRequestCheckLogs.js +2 -1
  220. package/dist/plus/integrations/reads/pullRequestCheckLogs.js.map +1 -1
  221. package/dist/plus/integrations/reads/pullRequests.js +4 -2
  222. package/dist/plus/integrations/reads/pullRequests.js.map +1 -1
  223. package/dist/plus/integrations/reads/pullRequestsForCommits.d.ts +1 -16
  224. package/dist/plus/integrations/reads/pullRequestsForCommits.js +2 -1
  225. package/dist/plus/integrations/reads/pullRequestsForCommits.js.map +1 -1
  226. package/dist/plus/integrations/reads/resolveRepository.js +10 -5
  227. package/dist/plus/integrations/reads/resolveRepository.js.map +1 -1
  228. package/dist/plus/integrations/reads/searchIssues.js +2 -1
  229. package/dist/plus/integrations/reads/searchIssues.js.map +1 -1
  230. package/dist/plus/integrations/reads/searchPullRequests.js +2 -1
  231. package/dist/plus/integrations/reads/searchPullRequests.js.map +1 -1
  232. package/dist/plus/integrations/reads/sweeps.d.ts +1 -1
  233. package/dist/plus/integrations/reads/sweeps.js +3 -2
  234. package/dist/plus/integrations/reads/sweeps.js.map +1 -1
  235. package/dist/plus/integrations/reads/warnings.d.ts +1 -1
  236. package/dist/plus/integrations/reads/warnings.js +1 -1
  237. package/dist/plus/integrations/reads/warnings.js.map +1 -1
  238. package/dist/plus/integrations/results.d.ts +324 -2
  239. package/dist/plus/integrations/results.js.map +1 -1
  240. package/dist/plus/integrations/telemetry.d.ts +0 -10
  241. package/dist/plus/integrations/telemetry.js +0 -11
  242. package/dist/plus/integrations/utils/domain.utils.d.ts +1 -0
  243. package/dist/plus/integrations/utils/domain.utils.js +10 -2
  244. package/dist/plus/integrations/utils/domain.utils.js.map +1 -1
  245. package/dist/plus/integrations/utils/integration.utils.d.ts +2 -6
  246. package/dist/plus/integrations/utils/integration.utils.js +8 -9
  247. package/dist/plus/integrations/utils/integration.utils.js.map +1 -1
  248. package/dist/utils/env/node/exec.js +2 -2
  249. package/dist/utils/keys/chord.d.ts +13 -2
  250. package/dist/utils/keys/chord.js +76 -17
  251. package/dist/utils/keys/chord.js.map +1 -1
  252. package/dist/utils/keys/keybinding.d.ts +12 -0
  253. package/dist/utils/keys/keybinding.js +52 -2
  254. package/dist/utils/keys/keybinding.js.map +1 -1
  255. package/dist/utils/markdown.d.ts +21 -0
  256. package/dist/utils/markdown.js +33 -1
  257. package/dist/utils/markdown.js.map +1 -1
  258. package/docs/integrations.md +174 -19
  259. package/package.json +5 -1
  260. package/dist/plus/integrations/authentication/integrationAuthenticationProvider.js.map +0 -1
  261. package/dist/plus/integrations/telemetry.js.map +0 -1
@@ -1,199 +0,0 @@
1
- import { CancellationError } from "../../../utils/cancellation.js";
2
- import { trace } from "../../../utils/decorators/log.js";
3
- import { Emitter } from "../../../utils/event.js";
4
- import __decorate from "../../../_virtual/@oxc-project+runtime/helpers/esm/decorate.js";
5
- import { areDomainsOnSameHost } from "../utils/domain.utils.js";
6
- import { isNonExpiringZeroTokenIntegrationId, isSelfManagedHostIntegrationId } from "../utils/integration.utils.js";
7
- import { isSupportedCloudIntegrationId } from "./models.js";
8
- //#region ../plus/integrations/src/authentication/integrationAuthenticationProvider.ts
9
- const maxSmallIntegerV8 = 2 ** 30 - 1;
10
- var IntegrationAuthenticationProviderBase = class {
11
- authenticationService;
12
- configuredIntegrationService;
13
- disposables = [];
14
- constructor(authenticationService, configuredIntegrationService) {
15
- this.authenticationService = authenticationService;
16
- this.configuredIntegrationService = configuredIntegrationService;
17
- }
18
- dispose() {
19
- this.disposables.forEach((d) => d.dispose());
20
- }
21
- _onDidChange = new Emitter();
22
- get onDidChange() {
23
- return this._onDidChange.event;
24
- }
25
- async deleteSession(descriptor, options) {
26
- const domain = isSelfManagedHostIntegrationId(this.authProviderId) ? descriptor?.domain : void 0;
27
- const configured = this.configuredIntegrationService.getConfigured(this.authProviderId, { domain });
28
- if (await this.configuredIntegrationService.deleteStoredSessions(this.authProviderId, {
29
- ...descriptor,
30
- cloud: true
31
- }, true, {
32
- preserveConfigured: options?.preserveConfigured ?? true,
33
- signOutMark: options?.signOutMark
34
- }) && configured?.length) this.fireChange();
35
- }
36
- async deleteAllSessions(descriptor) {
37
- const domain = isSelfManagedHostIntegrationId(this.authProviderId) ? descriptor?.domain : void 0;
38
- const configured = this.configuredIntegrationService.getConfigured(this.authProviderId, { domain });
39
- await this.configuredIntegrationService.deleteAllStoredSessions(this.authProviderId, void 0, domain);
40
- if (configured?.length) this.fireChange();
41
- }
42
- async getSession(descriptor, options) {
43
- let session;
44
- let previousToken;
45
- let refetched;
46
- let signOutMark;
47
- if (options?.forceNewSession) {
48
- if (isSelfManagedHostIntegrationId(this.authProviderId)) {
49
- const connectionId = descriptor.connectionId || this.configuredIntegrationService.getConfiguredConnectionId(this.authProviderId, descriptor.domain, true);
50
- if (!this.configuredIntegrationService.isConnectionConfiguredForHost(this.authProviderId, connectionId, descriptor.domain)) return;
51
- descriptor = {
52
- ...descriptor,
53
- connectionId
54
- };
55
- }
56
- await this.configuredIntegrationService.deleteStoredSessions(this.authProviderId, {
57
- ...descriptor,
58
- cloud: true
59
- }, true, {
60
- signOut: true,
61
- preserveConfigured: isSelfManagedHostIntegrationId(this.authProviderId)
62
- });
63
- signOutMark = this.configuredIntegrationService.getSignOutMark();
64
- } else {
65
- signOutMark = this.configuredIntegrationService.getSignOutMark();
66
- const stored = await this.configuredIntegrationService.getStoredSession(this.authProviderId, options?.sync ? {
67
- ...descriptor,
68
- cloud: true
69
- } : descriptor);
70
- previousToken = stored?.accessToken;
71
- if (options?.sync && options.refetch) refetched = stored;
72
- else session = stored;
73
- }
74
- const isExpiredSession = session?.expiresAt != null && new Date(session.expiresAt).getTime() < Date.now();
75
- const scopedRecovery = options?.isRejectedToken?.(session?.accessToken) === true;
76
- const refreshRejectedToken = scopedRecovery || options?.refreshRejectedToken === true && session != null;
77
- if (session == null || isExpiredSession || refreshRejectedToken) {
78
- session = await this.getNewSession(descriptor, {
79
- ...options,
80
- refreshIfExpired: isExpiredSession,
81
- refreshRejectedToken,
82
- isRejectedToken: scopedRecovery ? options?.isRejectedToken : void 0
83
- });
84
- if (session == null && options?.refetch && refetched != null && this.configuredIntegrationService.isSessionRetiredSince(this.authProviderId, refetched, signOutMark)) throw new CancellationError();
85
- if (session != null) {
86
- if (!await this.configuredIntegrationService.storeSession(this.authProviderId, session, {
87
- signOutMark,
88
- expectedStoredAccessToken: scopedRecovery ? previousToken : void 0
89
- })) {
90
- session = await this.configuredIntegrationService.getStoredSession(this.authProviderId, {
91
- ...descriptor,
92
- connectionId: session.id,
93
- cloud: session.cloud
94
- });
95
- options?.isRejectedToken?.(session?.accessToken);
96
- } else if (refetched?.id != null && refetched.id !== session.id) await this.configuredIntegrationService.deleteStoredSessions(this.authProviderId, {
97
- ...descriptor,
98
- connectionId: refetched.id,
99
- cloud: true
100
- }, true, { preserveConfigured: true });
101
- }
102
- }
103
- if (previousToken !== session?.accessToken) this.fireChange();
104
- return session;
105
- }
106
- fireChange() {
107
- queueMicrotask(() => this._onDidChange.fire());
108
- }
109
- };
110
- __decorate([trace()], IntegrationAuthenticationProviderBase.prototype, "deleteSession", null);
111
- __decorate([trace()], IntegrationAuthenticationProviderBase.prototype, "deleteAllSessions", null);
112
- __decorate([trace()], IntegrationAuthenticationProviderBase.prototype, "getSession", null);
113
- var CloudIntegrationAuthenticationProvider = class extends IntegrationAuthenticationProviderBase {
114
- _authProviderId;
115
- constructor(authenticationService, configuredIntegrationService, _authProviderId) {
116
- super(authenticationService, configuredIntegrationService);
117
- this._authProviderId = _authProviderId;
118
- }
119
- get authProviderId() {
120
- return this._authProviderId;
121
- }
122
- async getNewSession(descriptor, options) {
123
- if (options?.forceNewSession) {
124
- if (await this.disconnectCloudSession(descriptor) === "failure") return;
125
- this.connectCloudSession(false, options?.source);
126
- return;
127
- }
128
- let session = options?.refreshIfExpired || options?.refreshRejectedToken || options?.createIfNeeded || options?.forceNewSession || options?.sync ? await this.getCloudSession(descriptor, options) : void 0;
129
- if (options?.createIfNeeded && session == null) {
130
- if (!await this.connectCloudSession(true, options?.source)) return void 0;
131
- session = await this.getSession(descriptor, { source: options?.source });
132
- }
133
- return session;
134
- }
135
- connectCloudSession(skipIfConnected, source) {
136
- const id = this.authProviderId;
137
- if (isSupportedCloudIntegrationId(id)) return this.authenticationService.connectCloudIntegrations({
138
- integrationIds: [id],
139
- skipIfConnected,
140
- skipPreSync: true
141
- }, {
142
- source: source ?? "integrations",
143
- detail: {
144
- action: "connect",
145
- integration: id
146
- }
147
- });
148
- return Promise.resolve(false);
149
- }
150
- async getCloudSession(descriptor, options) {
151
- if (!(await this.authenticationService.ctx.account.getAccount() != null)) return void 0;
152
- const cloudIntegrations = this.authenticationService.cloudIntegrations;
153
- const connectionId = descriptor.connectionId ?? (isSelfManagedHostIntegrationId(this.authProviderId) ? this.configuredIntegrationService.getConfiguredConnectionId(this.authProviderId, descriptor.domain, true) : void 0);
154
- const scopedToThisHost = this.configuredIntegrationService.isConnectionConfiguredForHost(this.authProviderId, connectionId, descriptor.domain);
155
- const isForAnotherHost = (session) => session != null && isSelfManagedHostIntegrationId(this.authProviderId) && (!scopedToThisHost || Boolean(session.domain?.trim())) && !areDomainsOnSameHost(session.domain, descriptor.domain);
156
- let session = await cloudIntegrations.getConnectionSession(this.authProviderId, void 0, connectionId);
157
- if (isForAnotherHost(session)) return void 0;
158
- if (options?.isRejectedToken != null && session?.id != null && session.id !== connectionId) return void 0;
159
- if (session?.expiresIn === 0 && isNonExpiringZeroTokenIntegrationId(this.authProviderId)) session.expiresIn = maxSmallIntegerV8;
160
- if (session != null && (session.expiresIn < 60 || options?.refreshRejectedToken && (options.isRejectedToken?.(session.accessToken) ?? true))) {
161
- session = await cloudIntegrations.getConnectionSession(this.authProviderId, session.accessToken, connectionId);
162
- if (isForAnotherHost(session)) return void 0;
163
- if (options?.isRejectedToken != null && session?.id != null && session.id !== connectionId) return;
164
- }
165
- if (!session) return void 0;
166
- let sessionProtocol;
167
- if (/^[a-z][a-z\d+\-.]*:\/\//i.test(session.domain)) try {
168
- sessionProtocol = new URL(session.domain).protocol;
169
- } catch {
170
- sessionProtocol = void 0;
171
- }
172
- return {
173
- id: session.id ?? this.configuredIntegrationService.resolveConnectionId(this.authProviderId, descriptor),
174
- accessToken: session.accessToken,
175
- scopes: descriptor.scopes,
176
- account: {
177
- id: "",
178
- label: ""
179
- },
180
- cloud: true,
181
- type: session.type,
182
- expiresAt: new Date(session.expiresIn * 1e3 + Date.now()),
183
- domain: descriptor.domain,
184
- baseUrl: session.domain || this.configuredIntegrationService.getConfiguredBaseUrl(this.authProviderId, connectionId, descriptor.domain),
185
- protocol: sessionProtocol ?? void 0,
186
- appKey: session.appKey
187
- };
188
- }
189
- async disconnectCloudSession(descriptor) {
190
- if (!(await this.authenticationService.ctx.account.getAccount() != null)) return "skip";
191
- if (!await this.authenticationService.cloudIntegrations.disconnect(this.authProviderId, descriptor.connectionId)) return "failure";
192
- if (isSelfManagedHostIntegrationId(this.authProviderId)) await this.deleteSession(descriptor, { preserveConfigured: false });
193
- return "success";
194
- }
195
- };
196
- //#endregion
197
- export { CloudIntegrationAuthenticationProvider };
198
-
199
- //# sourceMappingURL=integrationAuthenticationProvider.js.map
@@ -1,13 +1,14 @@
1
1
  import { Disposable } from "../../../utils/disposable.js";
2
2
  import { GitRemote } from "../../../git/models/remote.js";
3
+ import { ProviderAuthenticationSession } from "./models.js";
3
4
  import { IntegrationIds, SupportedCloudIntegrationIds } from "../constants.js";
4
5
  import { Source } from "../telemetry.js";
6
+ import { IntegrationAuthenticationProvider, IntegrationAuthenticationSessionDescriptor } from "./integrationAuthenticationProvider.js";
7
+ import { IntegrationServiceContext } from "../context.js";
5
8
  import { ConfiguredIntegrationService } from "./configuredIntegrationService.js";
6
9
  import { GitHostIntegration } from "../models/gitHostIntegration.js";
7
10
  import { ApiClients } from "../providers/apiClients.js";
8
11
  import { IntegrationService } from "../integrationService.js";
9
- import { IntegrationAuthenticationProvider, IntegrationAuthenticationSessionDescriptor } from "./integrationAuthenticationProvider.js";
10
- import { IntegrationServiceContext } from "../context.js";
11
12
  import { CloudIntegrationService } from "./cloudIntegrationService.js";
12
13
  //#region ../plus/integrations/src/authentication/integrationAuthenticationService.d.ts
13
14
  export declare class IntegrationAuthenticationService implements Disposable {
@@ -57,6 +58,7 @@ export declare class IntegrationAuthenticationService implements Disposable {
57
58
  get apis(): ApiClients;
58
59
  get(providerId: IntegrationIds): Promise<IntegrationAuthenticationProvider>;
59
60
  getSignOutMark(): number;
61
+ trackStoredSession(id: IntegrationIds, session: ProviderAuthenticationSession): () => Promise<boolean>;
60
62
  /** The id of the connection a descriptor naming none reads: the primary configured for its host. */
61
63
  getPrimaryConnectionId(providerId: IntegrationIds, descriptor: IntegrationAuthenticationSessionDescriptor): string;
62
64
  reset(): Promise<void>;
@@ -3,7 +3,8 @@ import __decorate from "../../../_virtual/@oxc-project+runtime/helpers/esm/decor
3
3
  import { gate } from "../../../utils/decorators/gate.js";
4
4
  import "../constants.js";
5
5
  import { isSelfManagedHostIntegrationId, supportedIntegrationIds } from "../utils/integration.utils.js";
6
- import { CloudIntegrationAuthenticationProvider } from "./integrationAuthenticationProvider.js";
6
+ import { getSessionIdentity } from "./models.js";
7
+ import { CloudIntegrationAuthenticationProvider } from "./cloudIntegrationAuthenticationProvider.js";
7
8
  import { ObservedAuthenticationProvider } from "./observedAuthenticationProvider.js";
8
9
  //#region ../plus/integrations/src/authentication/integrationAuthenticationService.ts
9
10
  var IntegrationAuthenticationService = class {
@@ -52,6 +53,16 @@ var IntegrationAuthenticationService = class {
52
53
  getSignOutMark() {
53
54
  return this.configuredIntegrationService.getSignOutMark();
54
55
  }
56
+ trackStoredSession(id, session) {
57
+ const store = this.configuredIntegrationService;
58
+ const mark = store.getStoredWriteMark();
59
+ const identity = getSessionIdentity(session);
60
+ return async () => {
61
+ if (store.isStoredWriteRetiredSince(id, session, mark)) return false;
62
+ const current = await store.peekStoredSession(id, session.id, session.cloud ?? false, session.domain).catch(() => void 0);
63
+ return current != null && !store.isStoredWriteRetiredSince(id, session, mark) && getSessionIdentity(current) === identity && current.account?.id === session.account?.id;
64
+ };
65
+ }
55
66
  /** The id of the connection a descriptor naming none reads: the primary configured for its host. */
56
67
  getPrimaryConnectionId(providerId, descriptor) {
57
68
  return this.configuredIntegrationService.resolveConnectionId(providerId, descriptor);
@@ -1 +1 @@
1
- {"version":3,"file":"integrationAuthenticationService.js","names":[],"sources":["../../../../../plus/integrations/src/authentication/integrationAuthenticationService.ts"],"sourcesContent":["import type { GitRemote } from '@gitlens/git/models/remote.js';\nimport { gate } from '@gitlens/utils/decorators/gate.js';\nimport { debug } from '@gitlens/utils/decorators/log.js';\nimport type { Disposable } from '@gitlens/utils/disposable.js';\nimport type { IntegrationIds, SupportedCloudIntegrationIds } from '../constants.js';\nimport {\n\tGitCloudHostIntegrationId,\n\tGitSelfManagedHostIntegrationId,\n\tIssuesCloudHostIntegrationId,\n\tIssuesSelfManagedHostIntegrationId,\n} from '../constants.js';\nimport type { IntegrationServiceContext } from '../context.js';\nimport type { IntegrationService } from '../integrationService.js';\nimport type { GitHostIntegration } from '../models/gitHostIntegration.js';\nimport type { ApiClients } from '../providers/apiClients.js';\nimport type { Source } from '../telemetry.js';\nimport { isSelfManagedHostIntegrationId, supportedIntegrationIds } from '../utils/integration.utils.js';\nimport type { CloudIntegrationService } from './cloudIntegrationService.js';\nimport type { ConfiguredIntegrationService } from './configuredIntegrationService.js';\nimport type {\n\tIntegrationAuthenticationProvider,\n\tIntegrationAuthenticationSessionDescriptor,\n} from './integrationAuthenticationProvider.js';\nimport { CloudIntegrationAuthenticationProvider } from './integrationAuthenticationProvider.js';\nimport { ObservedAuthenticationProvider } from './observedAuthenticationProvider.js';\n\nexport class IntegrationAuthenticationService implements Disposable {\n\tprivate readonly providers = new Map<IntegrationIds, IntegrationAuthenticationProvider>();\n\n\tconstructor(\n\t\tprivate readonly configuredIntegrationService: ConfiguredIntegrationService,\n\t\treadonly ctx: IntegrationServiceContext,\n\t\t/**\n\t\t * Lazy accessor for the owning {@link IntegrationService}. Injected by the composition root\n\t\t * ({@link createIntegrationManager}) to break the auth↔service construction cycle without a\n\t\t * mutable setter or a host round-trip; only resolved at runtime (long after construction).\n\t\t */\n\t\tprivate readonly getIntegrationService: () => IntegrationService,\n\t\t/** The package's cloud token-exchange client, constructed by the composition root. */\n\t\treadonly cloudIntegrations: CloudIntegrationService,\n\t) {}\n\n\tdispose(): void {\n\t\tthis.providers.forEach(p => p.dispose());\n\t\tthis.providers.clear();\n\t}\n\n\t/**\n\t * Initiates the cloud-integration connect flow on the owning service. Cloud auth providers call\n\t * this when they need a session that doesn't exist yet (see\n\t * {@link CloudIntegrationAuthenticationProvider}).\n\t */\n\tconnectCloudIntegrations(\n\t\tconnect: { integrationIds: SupportedCloudIntegrationIds[]; skipIfConnected?: boolean; skipPreSync?: boolean },\n\t\tsource?: Source,\n\t): Promise<boolean> {\n\t\treturn this.getIntegrationService().connectCloudIntegrations(connect, source);\n\t}\n\n\t/**\n\t * Resolves the connected git-host integration for a `GitRemote`, via the owning service. Lets\n\t * package-internal callers (e.g. the Bitbucket provider) resolve a remote's integration without a\n\t * host round-trip.\n\t */\n\tgetByRemote(remote: GitRemote): Promise<GitHostIntegration | undefined> {\n\t\treturn this.getIntegrationService().getByRemote(remote);\n\t}\n\n\t/** Resolves the per-integration `ignoreSSLErrors` flag via the owning service (host-config-backed). */\n\tignoreSSLErrors(integration: GitHostIntegration | { id: IntegrationIds; domain?: string }): boolean | 'force' {\n\t\treturn this.getIntegrationService().ignoreSSLErrors(integration);\n\t}\n\n\t/** The package-built per-provider API clients, via the owning service (built once + memoized there). */\n\tget apis(): ApiClients {\n\t\treturn this.getIntegrationService().apis;\n\t}\n\n\tasync get(providerId: IntegrationIds): Promise<IntegrationAuthenticationProvider> {\n\t\treturn this.ensureProvider(providerId);\n\t}\n\n\tgetSignOutMark(): number {\n\t\treturn this.configuredIntegrationService.getSignOutMark();\n\t}\n\n\t/** The id of the connection a descriptor naming none reads: the primary configured for its host. */\n\tgetPrimaryConnectionId(providerId: IntegrationIds, descriptor: IntegrationAuthenticationSessionDescriptor): string {\n\t\treturn this.configuredIntegrationService.resolveConnectionId(providerId, descriptor);\n\t}\n\n\t@debug()\n\tasync reset(): Promise<void> {\n\t\t// TODO: This really isn't ideal, since it will only work for \"cloud\" providers as we won't have any more specific descriptors\n\t\tawait Promise.allSettled(\n\t\t\tsupportedIntegrationIds.map(async providerId =>\n\t\t\t\t(await this.ensureProvider(providerId)).deleteAllSessions(),\n\t\t\t),\n\t\t);\n\t}\n\n\tsupports(providerId: string): boolean {\n\t\t// Linear, Trello and Asana are cloud-backed issue integrations (same as Jira): `ensureProvider` registers a\n\t\t// cloud auth provider for them, so a disconnect must offer to sign out of the cloud token too —\n\t\t// otherwise the backend token and configured connection survive the disable.\n\t\tswitch (providerId) {\n\t\t\tcase GitCloudHostIntegrationId.AzureDevOps:\n\t\t\tcase GitSelfManagedHostIntegrationId.AzureDevOpsServer:\n\t\t\tcase GitCloudHostIntegrationId.Bitbucket:\n\t\t\tcase GitCloudHostIntegrationId.GitLab:\n\t\t\tcase IssuesCloudHostIntegrationId.Jira:\n\t\t\tcase IssuesSelfManagedHostIntegrationId.JiraServer:\n\t\t\tcase IssuesCloudHostIntegrationId.Linear:\n\t\t\tcase IssuesCloudHostIntegrationId.Trello:\n\t\t\tcase IssuesCloudHostIntegrationId.Asana:\n\t\t\tcase GitCloudHostIntegrationId.GitHub:\n\t\t\t\treturn true;\n\t\t\tdefault:\n\t\t\t\treturn false;\n\t\t}\n\t}\n\n\t@gate()\n\tprivate async ensureProvider(providerId: IntegrationIds): Promise<IntegrationAuthenticationProvider> {\n\t\tlet provider = this.providers.get(providerId);\n\t\tif (provider != null) return provider;\n\n\t\t// Optional consumer override for custom auth (e.g. a manual-token provider). GitLens omits it —\n\t\t// the package constructs its own cloud providers below (so GitLens's cloud auth needs no host hook).\n\t\tconst hostProvider = await this.ctx.hooks?.createAuthenticationProvider?.({\n\t\t\tid: providerId,\n\t\t});\n\t\tif (hostProvider != null) {\n\t\t\tprovider = new ObservedAuthenticationProvider(\n\t\t\t\thostProvider,\n\t\t\t\tisSelfManagedHostIntegrationId(providerId),\n\t\t\t\t(publication, domains) =>\n\t\t\t\t\tthis.getIntegrationService().onSessionPublishing(providerId, publication, domains),\n\t\t\t);\n\t\t\tthis.providers.set(providerId, provider);\n\t\t\treturn provider;\n\t\t}\n\n\t\t// Every cloud integration shares one provider, parameterized by id (cloud-only).\n\t\tswitch (providerId) {\n\t\t\tcase GitCloudHostIntegrationId.GitHub:\n\t\t\tcase GitSelfManagedHostIntegrationId.CloudGitHubEnterprise:\n\t\t\tcase GitCloudHostIntegrationId.GitLab:\n\t\t\tcase GitSelfManagedHostIntegrationId.CloudGitLabSelfHosted:\n\t\t\tcase GitCloudHostIntegrationId.AzureDevOps:\n\t\t\tcase GitSelfManagedHostIntegrationId.AzureDevOpsServer:\n\t\t\tcase GitCloudHostIntegrationId.Bitbucket:\n\t\t\tcase GitSelfManagedHostIntegrationId.BitbucketServer:\n\t\t\tcase IssuesCloudHostIntegrationId.Jira:\n\t\t\tcase IssuesSelfManagedHostIntegrationId.JiraServer:\n\t\t\tcase IssuesCloudHostIntegrationId.Linear:\n\t\t\tcase IssuesCloudHostIntegrationId.Trello:\n\t\t\tcase IssuesCloudHostIntegrationId.Asana:\n\t\t\t\tprovider = new CloudIntegrationAuthenticationProvider(\n\t\t\t\t\tthis,\n\t\t\t\t\tthis.configuredIntegrationService,\n\t\t\t\t\tproviderId,\n\t\t\t\t);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tthrow new Error(`No authentication provider registered for integration '${String(providerId)}'`);\n\t\t}\n\n\t\tthis.providers.set(providerId, provider);\n\t\treturn provider;\n\t}\n}\n"],"mappings":";;;;;;;;AA0BA,IAAa,mCAAb,MAAoE;CAIjD;CACR;CAMQ;CAER;CAZV,4BAA6B,IAAI,IAAuD;CAExF,YACC,8BACA,KAMA,uBAEA,mBACC;EAVgB,KAAA,+BAAA;EACR,KAAA,MAAA;EAMQ,KAAA,wBAAA;EAER,KAAA,oBAAA;CACP;CAEH,UAAgB;EACf,KAAK,UAAU,SAAQ,MAAK,EAAE,QAAQ,CAAC;EACvC,KAAK,UAAU,MAAM;CACtB;;;;;;CAOA,yBACC,SACA,QACmB;EACnB,OAAO,KAAK,sBAAsB,CAAC,CAAC,yBAAyB,SAAS,MAAM;CAC7E;;;;;;CAOA,YAAY,QAA4D;EACvE,OAAO,KAAK,sBAAsB,CAAC,CAAC,YAAY,MAAM;CACvD;;CAGA,gBAAgB,aAA8F;EAC7G,OAAO,KAAK,sBAAsB,CAAC,CAAC,gBAAgB,WAAW;CAChE;;CAGA,IAAI,OAAmB;EACtB,OAAO,KAAK,sBAAsB,CAAC,CAAC;CACrC;CAEA,MAAM,IAAI,YAAwE;EACjF,OAAO,KAAK,eAAe,UAAU;CACtC;CAEA,iBAAyB;EACxB,OAAO,KAAK,6BAA6B,eAAe;CACzD;;CAGA,uBAAuB,YAA4B,YAAgE;EAClH,OAAO,KAAK,6BAA6B,oBAAoB,YAAY,UAAU;CACpF;CAEA,MACM,QAAuB;EAE5B,MAAM,QAAQ,WACb,wBAAwB,IAAI,OAAM,gBAChC,MAAM,KAAK,eAAe,UAAU,EAAA,CAAG,kBAAkB,CAC3D,CACD;CACD;CAEA,SAAS,YAA6B;EAIrC,QAAQ,YAAR;GACC,KAAA;GACA,KAAA;GACA,KAAA;GACA,KAAA;GACA,KAAA;GACA,KAAA;GACA,KAAA;GACA,KAAA;GACA,KAAA;GACA,KAAA,UACC,OAAO;GACR,SACC,OAAO;EACT;CACD;CAEA,MACc,eAAe,YAAwE;EACpG,IAAI,WAAW,KAAK,UAAU,IAAI,UAAU;EAC5C,IAAI,YAAY,MAAM,OAAO;EAI7B,MAAM,eAAe,MAAM,KAAK,IAAI,OAAO,+BAA+B,EACzE,IAAI,WACL,CAAC;EACD,IAAI,gBAAgB,MAAM;GACzB,WAAW,IAAI,+BACd,cACA,+BAA+B,UAAU,IACxC,aAAa,YACb,KAAK,sBAAsB,CAAC,CAAC,oBAAoB,YAAY,aAAa,OAAO,CACnF;GACA,KAAK,UAAU,IAAI,YAAY,QAAQ;GACvC,OAAO;EACR;EAGA,QAAQ,YAAR;GACC,KAAA;GACA,KAAA;GACA,KAAA;GACA,KAAA;GACA,KAAA;GACA,KAAA;GACA,KAAA;GACA,KAAA;GACA,KAAA;GACA,KAAA;GACA,KAAA;GACA,KAAA;GACA,KAAA;IACC,WAAW,IAAI,uCACd,MACA,KAAK,8BACL,UACD;IACA;GACD,SACC,MAAM,IAAI,MAAM,0DAA0D,OAAO,UAAU,EAAE,EAAE;EACjG;EAEA,KAAK,UAAU,IAAI,YAAY,QAAQ;EACvC,OAAO;CACR;AACD;AAhFE,WAAA,CAAA,MAAM,CAAA,GAAA,iCAAA,WAAA,SAAA,IAAA;AA+BN,WAAA,CAAA,KAAK,CAAA,GAAA,iCAAA,WAAA,kBAAA,IAAA"}
1
+ {"version":3,"file":"integrationAuthenticationService.js","names":[],"sources":["../../../../../plus/integrations/src/authentication/integrationAuthenticationService.ts"],"sourcesContent":["import type { GitRemote } from '@gitlens/git/models/remote.js';\nimport { gate } from '@gitlens/utils/decorators/gate.js';\nimport { debug } from '@gitlens/utils/decorators/log.js';\nimport type { Disposable } from '@gitlens/utils/disposable.js';\nimport type { IntegrationIds, SupportedCloudIntegrationIds } from '../constants.js';\nimport {\n\tGitCloudHostIntegrationId,\n\tGitSelfManagedHostIntegrationId,\n\tIssuesCloudHostIntegrationId,\n\tIssuesSelfManagedHostIntegrationId,\n} from '../constants.js';\nimport type { IntegrationServiceContext } from '../context.js';\nimport type { IntegrationService } from '../integrationService.js';\nimport type { GitHostIntegration } from '../models/gitHostIntegration.js';\nimport type { ApiClients } from '../providers/apiClients.js';\nimport type { Source } from '../telemetry.js';\nimport { isSelfManagedHostIntegrationId, supportedIntegrationIds } from '../utils/integration.utils.js';\nimport { CloudIntegrationAuthenticationProvider } from './cloudIntegrationAuthenticationProvider.js';\nimport type { CloudIntegrationService } from './cloudIntegrationService.js';\nimport type { ConfiguredIntegrationService } from './configuredIntegrationService.js';\nimport type {\n\tIntegrationAuthenticationProvider,\n\tIntegrationAuthenticationSessionDescriptor,\n} from './integrationAuthenticationProvider.js';\nimport type { ProviderAuthenticationSession } from './models.js';\nimport { getSessionIdentity } from './models.js';\nimport { ObservedAuthenticationProvider } from './observedAuthenticationProvider.js';\n\nexport class IntegrationAuthenticationService implements Disposable {\n\tprivate readonly providers = new Map<IntegrationIds, IntegrationAuthenticationProvider>();\n\n\tconstructor(\n\t\tprivate readonly configuredIntegrationService: ConfiguredIntegrationService,\n\t\treadonly ctx: IntegrationServiceContext,\n\t\t/**\n\t\t * Lazy accessor for the owning {@link IntegrationService}. Injected by the composition root\n\t\t * ({@link createIntegrationManager}) to break the auth↔service construction cycle without a\n\t\t * mutable setter or a host round-trip; only resolved at runtime (long after construction).\n\t\t */\n\t\tprivate readonly getIntegrationService: () => IntegrationService,\n\t\t/** The package's cloud token-exchange client, constructed by the composition root. */\n\t\treadonly cloudIntegrations: CloudIntegrationService,\n\t) {}\n\n\tdispose(): void {\n\t\tthis.providers.forEach(p => p.dispose());\n\t\tthis.providers.clear();\n\t}\n\n\t/**\n\t * Initiates the cloud-integration connect flow on the owning service. Cloud auth providers call\n\t * this when they need a session that doesn't exist yet (see\n\t * {@link CloudIntegrationAuthenticationProvider}).\n\t */\n\tconnectCloudIntegrations(\n\t\tconnect: { integrationIds: SupportedCloudIntegrationIds[]; skipIfConnected?: boolean; skipPreSync?: boolean },\n\t\tsource?: Source,\n\t): Promise<boolean> {\n\t\treturn this.getIntegrationService().connectCloudIntegrations(connect, source);\n\t}\n\n\t/**\n\t * Resolves the connected git-host integration for a `GitRemote`, via the owning service. Lets\n\t * package-internal callers (e.g. the Bitbucket provider) resolve a remote's integration without a\n\t * host round-trip.\n\t */\n\tgetByRemote(remote: GitRemote): Promise<GitHostIntegration | undefined> {\n\t\treturn this.getIntegrationService().getByRemote(remote);\n\t}\n\n\t/** Resolves the per-integration `ignoreSSLErrors` flag via the owning service (host-config-backed). */\n\tignoreSSLErrors(integration: GitHostIntegration | { id: IntegrationIds; domain?: string }): boolean | 'force' {\n\t\treturn this.getIntegrationService().ignoreSSLErrors(integration);\n\t}\n\n\t/** The package-built per-provider API clients, via the owning service (built once + memoized there). */\n\tget apis(): ApiClients {\n\t\treturn this.getIntegrationService().apis;\n\t}\n\n\tasync get(providerId: IntegrationIds): Promise<IntegrationAuthenticationProvider> {\n\t\treturn this.ensureProvider(providerId);\n\t}\n\n\tgetSignOutMark(): number {\n\t\treturn this.configuredIntegrationService.getSignOutMark();\n\t}\n\n\ttrackStoredSession(id: IntegrationIds, session: ProviderAuthenticationSession): () => Promise<boolean> {\n\t\tconst store = this.configuredIntegrationService;\n\t\tconst mark = store.getStoredWriteMark();\n\t\tconst identity = getSessionIdentity(session);\n\t\treturn async () => {\n\t\t\tif (store.isStoredWriteRetiredSince(id, session, mark)) return false;\n\n\t\t\tconst current = await store\n\t\t\t\t.peekStoredSession(id, session.id, session.cloud ?? false, session.domain)\n\t\t\t\t.catch(() => undefined);\n\t\t\treturn (\n\t\t\t\tcurrent != null &&\n\t\t\t\t!store.isStoredWriteRetiredSince(id, session, mark) &&\n\t\t\t\tgetSessionIdentity(current) === identity &&\n\t\t\t\tcurrent.account?.id === session.account?.id\n\t\t\t);\n\t\t};\n\t}\n\n\t/** The id of the connection a descriptor naming none reads: the primary configured for its host. */\n\tgetPrimaryConnectionId(providerId: IntegrationIds, descriptor: IntegrationAuthenticationSessionDescriptor): string {\n\t\treturn this.configuredIntegrationService.resolveConnectionId(providerId, descriptor);\n\t}\n\n\t@debug()\n\tasync reset(): Promise<void> {\n\t\t// TODO: This really isn't ideal, since it will only work for \"cloud\" providers as we won't have any more specific descriptors\n\t\tawait Promise.allSettled(\n\t\t\tsupportedIntegrationIds.map(async providerId =>\n\t\t\t\t(await this.ensureProvider(providerId)).deleteAllSessions(),\n\t\t\t),\n\t\t);\n\t}\n\n\tsupports(providerId: string): boolean {\n\t\t// Linear, Trello and Asana are cloud-backed issue integrations (same as Jira): `ensureProvider` registers a\n\t\t// cloud auth provider for them, so a disconnect must offer to sign out of the cloud token too —\n\t\t// otherwise the backend token and configured connection survive the disable.\n\t\tswitch (providerId) {\n\t\t\tcase GitCloudHostIntegrationId.AzureDevOps:\n\t\t\tcase GitSelfManagedHostIntegrationId.AzureDevOpsServer:\n\t\t\tcase GitCloudHostIntegrationId.Bitbucket:\n\t\t\tcase GitCloudHostIntegrationId.GitLab:\n\t\t\tcase IssuesCloudHostIntegrationId.Jira:\n\t\t\tcase IssuesSelfManagedHostIntegrationId.JiraServer:\n\t\t\tcase IssuesCloudHostIntegrationId.Linear:\n\t\t\tcase IssuesCloudHostIntegrationId.Trello:\n\t\t\tcase IssuesCloudHostIntegrationId.Asana:\n\t\t\tcase GitCloudHostIntegrationId.GitHub:\n\t\t\t\treturn true;\n\t\t\tdefault:\n\t\t\t\treturn false;\n\t\t}\n\t}\n\n\t@gate()\n\tprivate async ensureProvider(providerId: IntegrationIds): Promise<IntegrationAuthenticationProvider> {\n\t\tlet provider = this.providers.get(providerId);\n\t\tif (provider != null) return provider;\n\n\t\t// Optional consumer override for custom auth (e.g. a manual-token provider). GitLens omits it —\n\t\t// the package constructs its own cloud providers below (so GitLens's cloud auth needs no host hook).\n\t\tconst hostProvider = await this.ctx.hooks?.createAuthenticationProvider?.({\n\t\t\tid: providerId,\n\t\t});\n\t\tif (hostProvider != null) {\n\t\t\tprovider = new ObservedAuthenticationProvider(\n\t\t\t\thostProvider,\n\t\t\t\tisSelfManagedHostIntegrationId(providerId),\n\t\t\t\t(publication, domains) =>\n\t\t\t\t\tthis.getIntegrationService().onSessionPublishing(providerId, publication, domains),\n\t\t\t);\n\t\t\tthis.providers.set(providerId, provider);\n\t\t\treturn provider;\n\t\t}\n\n\t\t// Every cloud integration shares one provider, parameterized by id (cloud-only).\n\t\tswitch (providerId) {\n\t\t\tcase GitCloudHostIntegrationId.GitHub:\n\t\t\tcase GitSelfManagedHostIntegrationId.CloudGitHubEnterprise:\n\t\t\tcase GitCloudHostIntegrationId.GitLab:\n\t\t\tcase GitSelfManagedHostIntegrationId.CloudGitLabSelfHosted:\n\t\t\tcase GitCloudHostIntegrationId.AzureDevOps:\n\t\t\tcase GitSelfManagedHostIntegrationId.AzureDevOpsServer:\n\t\t\tcase GitCloudHostIntegrationId.Bitbucket:\n\t\t\tcase GitSelfManagedHostIntegrationId.BitbucketServer:\n\t\t\tcase IssuesCloudHostIntegrationId.Jira:\n\t\t\tcase IssuesSelfManagedHostIntegrationId.JiraServer:\n\t\t\tcase IssuesCloudHostIntegrationId.Linear:\n\t\t\tcase IssuesCloudHostIntegrationId.Trello:\n\t\t\tcase IssuesCloudHostIntegrationId.Asana:\n\t\t\t\tprovider = new CloudIntegrationAuthenticationProvider(\n\t\t\t\t\tthis,\n\t\t\t\t\tthis.configuredIntegrationService,\n\t\t\t\t\tproviderId,\n\t\t\t\t);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tthrow new Error(`No authentication provider registered for integration '${String(providerId)}'`);\n\t\t}\n\n\t\tthis.providers.set(providerId, provider);\n\t\treturn provider;\n\t}\n}\n"],"mappings":";;;;;;;;;AA4BA,IAAa,mCAAb,MAAoE;CAIjD;CACR;CAMQ;CAER;CAZV,4BAA6B,IAAI,IAAuD;CAExF,YACC,8BACA,KAMA,uBAEA,mBACC;EAVgB,KAAA,+BAAA;EACR,KAAA,MAAA;EAMQ,KAAA,wBAAA;EAER,KAAA,oBAAA;CACP;CAEH,UAAgB;EACf,KAAK,UAAU,SAAQ,MAAK,EAAE,QAAQ,CAAC;EACvC,KAAK,UAAU,MAAM;CACtB;;;;;;CAOA,yBACC,SACA,QACmB;EACnB,OAAO,KAAK,sBAAsB,CAAC,CAAC,yBAAyB,SAAS,MAAM;CAC7E;;;;;;CAOA,YAAY,QAA4D;EACvE,OAAO,KAAK,sBAAsB,CAAC,CAAC,YAAY,MAAM;CACvD;;CAGA,gBAAgB,aAA8F;EAC7G,OAAO,KAAK,sBAAsB,CAAC,CAAC,gBAAgB,WAAW;CAChE;;CAGA,IAAI,OAAmB;EACtB,OAAO,KAAK,sBAAsB,CAAC,CAAC;CACrC;CAEA,MAAM,IAAI,YAAwE;EACjF,OAAO,KAAK,eAAe,UAAU;CACtC;CAEA,iBAAyB;EACxB,OAAO,KAAK,6BAA6B,eAAe;CACzD;CAEA,mBAAmB,IAAoB,SAAgE;EACtG,MAAM,QAAQ,KAAK;EACnB,MAAM,OAAO,MAAM,mBAAmB;EACtC,MAAM,WAAW,mBAAmB,OAAO;EAC3C,OAAO,YAAY;GAClB,IAAI,MAAM,0BAA0B,IAAI,SAAS,IAAI,GAAG,OAAO;GAE/D,MAAM,UAAU,MAAM,MACpB,kBAAkB,IAAI,QAAQ,IAAI,QAAQ,SAAS,OAAO,QAAQ,MAAM,CAAC,CACzE,YAAY,KAAA,CAAS;GACvB,OACC,WAAW,QACX,CAAC,MAAM,0BAA0B,IAAI,SAAS,IAAI,KAClD,mBAAmB,OAAO,MAAM,YAChC,QAAQ,SAAS,OAAO,QAAQ,SAAS;EAE3C;CACD;;CAGA,uBAAuB,YAA4B,YAAgE;EAClH,OAAO,KAAK,6BAA6B,oBAAoB,YAAY,UAAU;CACpF;CAEA,MACM,QAAuB;EAE5B,MAAM,QAAQ,WACb,wBAAwB,IAAI,OAAM,gBAChC,MAAM,KAAK,eAAe,UAAU,EAAA,CAAG,kBAAkB,CAC3D,CACD;CACD;CAEA,SAAS,YAA6B;EAIrC,QAAQ,YAAR;GACC,KAAA;GACA,KAAA;GACA,KAAA;GACA,KAAA;GACA,KAAA;GACA,KAAA;GACA,KAAA;GACA,KAAA;GACA,KAAA;GACA,KAAA,UACC,OAAO;GACR,SACC,OAAO;EACT;CACD;CAEA,MACc,eAAe,YAAwE;EACpG,IAAI,WAAW,KAAK,UAAU,IAAI,UAAU;EAC5C,IAAI,YAAY,MAAM,OAAO;EAI7B,MAAM,eAAe,MAAM,KAAK,IAAI,OAAO,+BAA+B,EACzE,IAAI,WACL,CAAC;EACD,IAAI,gBAAgB,MAAM;GACzB,WAAW,IAAI,+BACd,cACA,+BAA+B,UAAU,IACxC,aAAa,YACb,KAAK,sBAAsB,CAAC,CAAC,oBAAoB,YAAY,aAAa,OAAO,CACnF;GACA,KAAK,UAAU,IAAI,YAAY,QAAQ;GACvC,OAAO;EACR;EAGA,QAAQ,YAAR;GACC,KAAA;GACA,KAAA;GACA,KAAA;GACA,KAAA;GACA,KAAA;GACA,KAAA;GACA,KAAA;GACA,KAAA;GACA,KAAA;GACA,KAAA;GACA,KAAA;GACA,KAAA;GACA,KAAA;IACC,WAAW,IAAI,uCACd,MACA,KAAK,8BACL,UACD;IACA;GACD,SACC,MAAM,IAAI,MAAM,0DAA0D,OAAO,UAAU,EAAE,EAAE;EACjG;EAEA,KAAK,UAAU,IAAI,YAAY,QAAQ;EACvC,OAAO;CACR;AACD;AAhFE,WAAA,CAAA,MAAM,CAAA,GAAA,iCAAA,WAAA,SAAA,IAAA;AA+BN,WAAA,CAAA,KAAK,CAAA,GAAA,iCAAA,WAAA,kBAAA,IAAA"}
@@ -148,7 +148,6 @@ export interface CloudIntegrationConnection {
148
148
  }
149
149
  export type CloudIntegrationType = 'jira' | 'jiraServer' | 'linear' | 'trello' | 'asana' | 'gitlab' | 'github' | 'bitbucket' | 'bitbucketServer' | 'azure' | 'azureDevopsServer' | 'githubEnterprise' | 'gitlabSelfHosted';
150
150
  export type CloudIntegrationAuthType = 'oauth' | 'pat';
151
- export declare const CloudIntegrationAuthenticationUriPathPrefix = "did-authenticate-cloud-integration";
152
151
  /** Returns all supported cloud integration ids. */
153
152
  export declare function getSupportedCloudIntegrationIds(): readonly SupportedCloudIntegrationIds[];
154
153
  /** Whether `id` is a supported cloud integration id. */
@@ -32,7 +32,6 @@ function toTokenWithInfo(providerId, session, altToken) {
32
32
  connectionId: session.id
33
33
  };
34
34
  }
35
- const CloudIntegrationAuthenticationUriPathPrefix = "did-authenticate-cloud-integration";
36
35
  /** Returns all supported cloud integration ids. */
37
36
  function getSupportedCloudIntegrationIds() {
38
37
  return supportedOrderedCloudIntegrationIds;
@@ -75,6 +74,6 @@ const toCloudIntegrationType = {
75
74
  ["bitbucket-server"]: "bitbucketServer"
76
75
  };
77
76
  //#endregion
78
- export { CloudIntegrationAuthenticationUriPathPrefix, getSessionIdentity, getSupportedCloudIntegrationIds, isIssueCloudIntegrationId, isSupportedCloudIntegrationId, toCloudIntegrationType, toIntegrationId, toTokenInfo, toTokenWithInfo };
77
+ export { getSessionIdentity, getSupportedCloudIntegrationIds, isIssueCloudIntegrationId, isSupportedCloudIntegrationId, toCloudIntegrationType, toIntegrationId, toTokenInfo, toTokenWithInfo };
79
78
 
80
79
  //# sourceMappingURL=models.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"models.js","names":[],"sources":["../../../../../plus/integrations/src/authentication/models.ts"],"sourcesContent":["import { microhash } from '@gitlens/utils/hash.js';\nimport type { IntegrationIds, SupportedCloudIntegrationIds } from '../constants.js';\nimport {\n\tGitCloudHostIntegrationId,\n\tGitSelfManagedHostIntegrationId,\n\tIssuesCloudHostIntegrationId,\n\tIssuesSelfManagedHostIntegrationId,\n\tsupportedOrderedCloudIntegrationIds,\n} from '../constants.js';\n\n/**\n * Mirrors the shape of `vscode.AuthenticationSession` so the integrations\n * package can stay vscode-free. Host adapters bridge VS Code sessions to\n * this shape via {@link AuthenticationProvider}.\n */\nexport interface AuthenticationSessionLike {\n\treadonly id: string;\n\treadonly accessToken: string;\n\treadonly account: { readonly id: string; readonly label: string };\n\treadonly scopes: readonly string[];\n}\n\nexport interface ProviderAuthenticationSession extends AuthenticationSessionLike {\n\treadonly cloud: boolean;\n\treadonly type: CloudIntegrationAuthType | undefined;\n\treadonly expiresAt?: Date;\n\treadonly domain: string;\n\t/**\n\t * The connection's address exactly as it was configured, path and all, when that differs from\n\t * {@link domain}.\n\t *\n\t * `domain` is the IDENTITY a self-managed connection is keyed by, so it is normalized to a bare host\n\t * (`hostFromDomain`) and one host cannot key two connections. An instance mounted below a context path —\n\t * Jira Data Center's `/jira`, a reverse-proxied GitLab or Bitbucket — still has to be ADDRESSED at that\n\t * path, and normalizing it away is what made every request go to the root. Absent when the backend\n\t * reported nothing beyond the host, which is the common case.\n\t */\n\treadonly baseUrl?: string;\n\treadonly protocol?: string;\n\t/** The provider app key paired with the token for providers whose client needs one (e.g. Trello). */\n\treadonly appKey?: string;\n}\n\nexport type SessionPublication = {\n\treadonly session?: ProviderAuthenticationSession;\n\treadonly previousSessionId?: string;\n\treadonly connectionId?: string;\n\t/** A removal has no session from which to recover the affected storage variant. */\n\treadonly cloud?: boolean;\n\treadonly replacePrimary?: boolean;\n\treadonly retireAll?: boolean;\n};\n\nexport function getSessionIdentity(\n\tsession:\n\t\t| Partial<\n\t\t\t\tPick<\n\t\t\t\t\tProviderAuthenticationSession,\n\t\t\t\t\t'id' | 'accessToken' | 'domain' | 'baseUrl' | 'protocol' | 'appKey' | 'type' | 'cloud'\n\t\t\t\t>\n\t\t >\n\t\t| null\n\t\t| undefined,\n): string | undefined {\n\treturn session == null\n\t\t? undefined\n\t\t: JSON.stringify([\n\t\t\t\tsession.id,\n\t\t\t\tsession.accessToken,\n\t\t\t\tsession.domain,\n\t\t\t\tsession.baseUrl,\n\t\t\t\tsession.protocol,\n\t\t\t\tsession.appKey,\n\t\t\t\tsession.type,\n\t\t\t\tsession.cloud,\n\t\t\t]);\n}\n\nexport interface TokenInfo<T extends IntegrationIds | 'gitkraken' = IntegrationIds | 'gitkraken'> {\n\treadonly providerId: T;\n\t/**\n\t * The first 3 characters of the md5 hash of the token.\n\t * It's a very obfuscated representation of the token that we can use in logs\n\t * to see whether the token survives refreshing or gets updated.\n\t */\n\treadonly microHash: string | undefined;\n\treadonly cloud: boolean;\n\treadonly type: CloudIntegrationAuthType | undefined;\n\treadonly scopes: readonly string[] | undefined;\n\treadonly expiresAt?: Date;\n}\n\nexport interface TokenWithInfo<T extends IntegrationIds = IntegrationIds> extends TokenInfo<T> {\n\treadonly accessToken: string;\n\t/** The token's connection (its session's id), which a failed request's strike counts against. */\n\treadonly connectionId?: string;\n}\n\nexport function toTokenInfo<T extends IntegrationIds | 'gitkraken'>(\n\tproviderId: T,\n\taccessToken: string | undefined,\n\tinfo: { cloud: boolean; type: CloudIntegrationAuthType | undefined; scopes?: readonly string[]; expiresAt?: Date },\n): TokenInfo<T> {\n\treturn {\n\t\tproviderId: providerId,\n\t\tmicroHash: microhash(accessToken, 3),\n\t\tcloud: info.cloud,\n\t\ttype: info.type,\n\t\tscopes: info.scopes,\n\t\texpiresAt: info.expiresAt,\n\t};\n}\n\nexport function toTokenWithInfo<T extends IntegrationIds>(\n\tproviderId: T,\n\tsession: ProviderAuthenticationSession,\n\taltToken?: string,\n): TokenWithInfo<T> {\n\tconst { accessToken: sessionToken, ...sessionInfo } = session;\n\tconst accessToken = altToken ?? session.accessToken;\n\treturn {\n\t\t// pass original token info to form the correlated microhash\n\t\t...toTokenInfo(providerId, sessionToken, sessionInfo),\n\t\t// use the actual token used for the request\n\t\taccessToken: accessToken,\n\t\tconnectionId: session.id,\n\t};\n}\n\nexport type TokenOptInfo<T extends IntegrationIds = IntegrationIds> =\n\t| TokenWithInfo<T>\n\t// `connectionId` targets a specific connection (multi-account) when the token still has to be resolved.\n\t// Omitted resolves the provider's primary connection, preserving the pre-multi-account behavior.\n\t| { providerId: T; accessToken?: undefined; connectionId?: string };\n\nexport interface ConfiguredIntegrationDescriptor {\n\t/**\n\t * Stable per-connection identifier, distinct from the domain, so multiple accounts can be\n\t * connected to the same provider+domain simultaneously. For legacy/migrated single connections\n\t * this is the domain (self-managed) or the provider's canonical domain (cloud), which keeps the\n\t * existing secret key (`integration.auth[.cloud]:{id}|{domain}`) valid with zero migration.\n\t */\n\treadonly id: string;\n\t/**\n\t * Whether this is the connection used by default for the provider. Optional: when no descriptor\n\t * for a provider+domain carries an explicit flag, the first one is treated as primary. Only\n\t * {@link ConfiguredIntegrationService.setPrimaryConnection} sets the flag (and clears it on siblings).\n\t */\n\treadonly primary?: boolean;\n\t/** The connection's auth type (`oauth`/`pat`), when known. */\n\treadonly type?: CloudIntegrationAuthType;\n\t/**\n\t * Human-readable account handle for this connection (e.g. the GitHub login). Resolved from the\n\t * provider API (the token backend doesn't expose it); absent until resolved or if the lookup fails.\n\t */\n\treadonly accountName?: string;\n\t/**\n\t * Workspace the connection's token was granted for (Linear), separate from the person. Resolved with the\n\t * connection's own token and kept by connection id; both are set together, or neither is.\n\t */\n\treadonly resourceName?: string;\n\treadonly resourceId?: string;\n\treadonly cloud: boolean;\n\treadonly integrationId: IntegrationIds;\n\treadonly scopes: string;\n\treadonly domain?: string;\n\t/**\n\t * The address this connection was configured with, path included — see\n\t * {@link ProviderAuthenticationSession.baseUrl}.\n\t *\n\t * Mirrored onto the descriptor so reconciliation can tell a re-pointed connection from an unchanged one\n\t * without reading its secret: {@link domain} is normalized to a bare host, so a backend connection moved\n\t * from one context path to another on the SAME host looks identical by domain alone.\n\t */\n\treadonly baseUrl?: string;\n\treadonly expiresAt?: string | Date;\n}\n\nexport interface CloudIntegrationAuthenticationSession {\n\ttype: CloudIntegrationAuthType;\n\taccessToken: string;\n\tdomain: string;\n\texpiresIn: number;\n\tscopes: string;\n\t/** Backend per-connection token identifier, when the provider-tokens backend supports multi-account. */\n\tid?: string;\n\t/** Provider app key paired with the token (e.g. Trello app key), when the backend supplies one. */\n\tappKey?: string;\n}\n\nexport interface CloudIntegrationAuthorization {\n\turl: string;\n}\n\n/** Workspace a connection's token was granted for; only ever a complete pair. */\nexport interface ConnectionResource {\n\treadonly id: string;\n\treadonly name: string;\n}\n\nexport interface CloudIntegrationConnection {\n\ttype: CloudIntegrationAuthType;\n\tprovider: CloudIntegrationType;\n\tdomain: string;\n\t/** Backend per-connection token identifier, when the provider-tokens backend supports multi-account. */\n\tid?: string;\n\t/** Whether the backend marks this connection as the primary/default for the provider. */\n\tprimary?: boolean;\n\t/** Human-readable account handle, when the backend provides it on the connection (may be absent). */\n\taccountName?: string;\n}\n\nexport type CloudIntegrationType =\n\t| 'jira'\n\t| 'jiraServer'\n\t| 'linear'\n\t| 'trello'\n\t| 'asana'\n\t| 'gitlab'\n\t| 'github'\n\t| 'bitbucket'\n\t| 'bitbucketServer'\n\t| 'azure'\n\t| 'azureDevopsServer'\n\t| 'githubEnterprise'\n\t| 'gitlabSelfHosted';\n\nexport type CloudIntegrationAuthType = 'oauth' | 'pat';\n\nexport const CloudIntegrationAuthenticationUriPathPrefix = 'did-authenticate-cloud-integration';\n\n/** Returns all supported cloud integration ids. */\nexport function getSupportedCloudIntegrationIds(): readonly SupportedCloudIntegrationIds[] {\n\t// Return the shared const directly (readonly so callers can't mutate it) — this runs on hot,\n\t// per-integration membership paths, so avoid allocating a fresh array per call.\n\treturn supportedOrderedCloudIntegrationIds;\n}\n\n/** Whether `id` is a supported cloud integration id. */\nexport function isSupportedCloudIntegrationId(id: string): id is SupportedCloudIntegrationIds {\n\treturn getSupportedCloudIntegrationIds().includes(id as SupportedCloudIntegrationIds);\n}\n\nexport function isIssueCloudIntegrationId(id: string): id is IssuesCloudHostIntegrationId {\n\tconst issueIds: string[] = Object.values(IssuesCloudHostIntegrationId);\n\treturn issueIds.includes(id);\n}\n\nexport const toIntegrationId: { [key in CloudIntegrationType]: IntegrationIds } = {\n\tjira: IssuesCloudHostIntegrationId.Jira,\n\tjiraServer: IssuesSelfManagedHostIntegrationId.JiraServer,\n\tlinear: IssuesCloudHostIntegrationId.Linear,\n\ttrello: IssuesCloudHostIntegrationId.Trello,\n\tasana: IssuesCloudHostIntegrationId.Asana,\n\tgitlab: GitCloudHostIntegrationId.GitLab,\n\tgithub: GitCloudHostIntegrationId.GitHub,\n\tgithubEnterprise: GitSelfManagedHostIntegrationId.CloudGitHubEnterprise,\n\tgitlabSelfHosted: GitSelfManagedHostIntegrationId.CloudGitLabSelfHosted,\n\tbitbucket: GitCloudHostIntegrationId.Bitbucket,\n\tbitbucketServer: GitSelfManagedHostIntegrationId.BitbucketServer,\n\tazure: GitCloudHostIntegrationId.AzureDevOps,\n\tazureDevopsServer: GitSelfManagedHostIntegrationId.AzureDevOpsServer,\n};\n\nexport const toCloudIntegrationType: { [key in IntegrationIds]: CloudIntegrationType | undefined } = {\n\t[IssuesCloudHostIntegrationId.Jira]: 'jira',\n\t[IssuesSelfManagedHostIntegrationId.JiraServer]: 'jiraServer',\n\t[IssuesCloudHostIntegrationId.Linear]: 'linear',\n\t[IssuesCloudHostIntegrationId.Trello]: 'trello',\n\t[IssuesCloudHostIntegrationId.Asana]: 'asana',\n\t[GitCloudHostIntegrationId.GitLab]: 'gitlab',\n\t[GitCloudHostIntegrationId.GitHub]: 'github',\n\t[GitCloudHostIntegrationId.Bitbucket]: 'bitbucket',\n\t[GitCloudHostIntegrationId.AzureDevOps]: 'azure',\n\t[GitSelfManagedHostIntegrationId.AzureDevOpsServer]: 'azureDevopsServer',\n\t[GitSelfManagedHostIntegrationId.CloudGitHubEnterprise]: 'githubEnterprise',\n\t[GitSelfManagedHostIntegrationId.CloudGitLabSelfHosted]: 'gitlabSelfHosted',\n\t[GitSelfManagedHostIntegrationId.BitbucketServer]: 'bitbucketServer',\n};\n"],"mappings":";;;AAqDA,SAAgB,mBACf,SASqB;CACrB,OAAO,WAAW,OACf,KAAA,IACA,KAAK,UAAU;EACf,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;CACT,CAAC;AACJ;AAsBA,SAAgB,YACf,YACA,aACA,MACe;CACf,OAAO;EACM;EACZ,WAAW,UAAU,aAAa,CAAC;EACnC,OAAO,KAAK;EACZ,MAAM,KAAK;EACX,QAAQ,KAAK;EACb,WAAW,KAAK;CACjB;AACD;AAEA,SAAgB,gBACf,YACA,SACA,UACmB;CACnB,MAAM,EAAE,aAAa,cAAc,GAAG,gBAAgB;CACtD,MAAM,cAAc,YAAY,QAAQ;CACxC,OAAO;EAEN,GAAG,YAAY,YAAY,cAAc,WAAW;EAEvC;EACb,cAAc,QAAQ;CACvB;AACD;AAsGA,MAAa,8CAA8C;;AAG3D,SAAgB,kCAA2E;CAG1F,OAAO;AACR;;AAGA,SAAgB,8BAA8B,IAAgD;CAC7F,OAAO,gCAAgC,CAAC,CAAC,SAAS,EAAkC;AACrF;AAEA,SAAgB,0BAA0B,IAAgD;CAEzF,OAD2B,OAAO,OAAO,4BAC3B,CAAC,CAAC,SAAS,EAAE;AAC5B;AAEA,MAAa,kBAAqE;CACjF,MAAA;CACA,YAAA;CACA,QAAA;CACA,QAAA;CACA,OAAA;CACA,QAAA;CACA,QAAA;CACA,kBAAA;CACA,kBAAA;CACA,WAAA;CACA,iBAAA;CACA,OAAA;CACA,mBAAA;AACD;AAEA,MAAa,yBAAwF;EAC/D,SAAA;EACY,gBAAA;EACV,WAAA;EACA,WAAA;EACD,UAAA;EACF,WAAA;EACA,WAAA;EACG,cAAA;EACE,gBAAA;EACY,wBAAA;EACI,4BAAA;EACA,6BAAA;EACN,qBAAA;AACpD"}
1
+ {"version":3,"file":"models.js","names":[],"sources":["../../../../../plus/integrations/src/authentication/models.ts"],"sourcesContent":["import { microhash } from '@gitlens/utils/hash.js';\nimport type { IntegrationIds, SupportedCloudIntegrationIds } from '../constants.js';\nimport {\n\tGitCloudHostIntegrationId,\n\tGitSelfManagedHostIntegrationId,\n\tIssuesCloudHostIntegrationId,\n\tIssuesSelfManagedHostIntegrationId,\n\tsupportedOrderedCloudIntegrationIds,\n} from '../constants.js';\n\n/**\n * Mirrors the shape of `vscode.AuthenticationSession` so the integrations\n * package can stay vscode-free. Host adapters bridge VS Code sessions to\n * this shape via {@link AuthenticationProvider}.\n */\nexport interface AuthenticationSessionLike {\n\treadonly id: string;\n\treadonly accessToken: string;\n\treadonly account: { readonly id: string; readonly label: string };\n\treadonly scopes: readonly string[];\n}\n\nexport interface ProviderAuthenticationSession extends AuthenticationSessionLike {\n\treadonly cloud: boolean;\n\treadonly type: CloudIntegrationAuthType | undefined;\n\treadonly expiresAt?: Date;\n\treadonly domain: string;\n\t/**\n\t * The connection's address exactly as it was configured, path and all, when that differs from\n\t * {@link domain}.\n\t *\n\t * `domain` is the IDENTITY a self-managed connection is keyed by, so it is normalized to a bare host\n\t * (`hostFromDomain`) and one host cannot key two connections. An instance mounted below a context path —\n\t * Jira Data Center's `/jira`, a reverse-proxied GitLab or Bitbucket — still has to be ADDRESSED at that\n\t * path, and normalizing it away is what made every request go to the root. Absent when the backend\n\t * reported nothing beyond the host, which is the common case.\n\t */\n\treadonly baseUrl?: string;\n\treadonly protocol?: string;\n\t/** The provider app key paired with the token for providers whose client needs one (e.g. Trello). */\n\treadonly appKey?: string;\n}\n\nexport type SessionPublication = {\n\treadonly session?: ProviderAuthenticationSession;\n\treadonly previousSessionId?: string;\n\treadonly connectionId?: string;\n\t/** A removal has no session from which to recover the affected storage variant. */\n\treadonly cloud?: boolean;\n\treadonly replacePrimary?: boolean;\n\treadonly retireAll?: boolean;\n};\n\nexport function getSessionIdentity(\n\tsession:\n\t\t| Partial<\n\t\t\t\tPick<\n\t\t\t\t\tProviderAuthenticationSession,\n\t\t\t\t\t'id' | 'accessToken' | 'domain' | 'baseUrl' | 'protocol' | 'appKey' | 'type' | 'cloud'\n\t\t\t\t>\n\t\t >\n\t\t| null\n\t\t| undefined,\n): string | undefined {\n\treturn session == null\n\t\t? undefined\n\t\t: JSON.stringify([\n\t\t\t\tsession.id,\n\t\t\t\tsession.accessToken,\n\t\t\t\tsession.domain,\n\t\t\t\tsession.baseUrl,\n\t\t\t\tsession.protocol,\n\t\t\t\tsession.appKey,\n\t\t\t\tsession.type,\n\t\t\t\tsession.cloud,\n\t\t\t]);\n}\n\nexport interface TokenInfo<T extends IntegrationIds | 'gitkraken' = IntegrationIds | 'gitkraken'> {\n\treadonly providerId: T;\n\t/**\n\t * The first 3 characters of the md5 hash of the token.\n\t * It's a very obfuscated representation of the token that we can use in logs\n\t * to see whether the token survives refreshing or gets updated.\n\t */\n\treadonly microHash: string | undefined;\n\treadonly cloud: boolean;\n\treadonly type: CloudIntegrationAuthType | undefined;\n\treadonly scopes: readonly string[] | undefined;\n\treadonly expiresAt?: Date;\n}\n\nexport interface TokenWithInfo<T extends IntegrationIds = IntegrationIds> extends TokenInfo<T> {\n\treadonly accessToken: string;\n\t/** The token's connection (its session's id), which a failed request's strike counts against. */\n\treadonly connectionId?: string;\n}\n\nexport function toTokenInfo<T extends IntegrationIds | 'gitkraken'>(\n\tproviderId: T,\n\taccessToken: string | undefined,\n\tinfo: { cloud: boolean; type: CloudIntegrationAuthType | undefined; scopes?: readonly string[]; expiresAt?: Date },\n): TokenInfo<T> {\n\treturn {\n\t\tproviderId: providerId,\n\t\tmicroHash: microhash(accessToken, 3),\n\t\tcloud: info.cloud,\n\t\ttype: info.type,\n\t\tscopes: info.scopes,\n\t\texpiresAt: info.expiresAt,\n\t};\n}\n\nexport function toTokenWithInfo<T extends IntegrationIds>(\n\tproviderId: T,\n\tsession: ProviderAuthenticationSession,\n\taltToken?: string,\n): TokenWithInfo<T> {\n\tconst { accessToken: sessionToken, ...sessionInfo } = session;\n\tconst accessToken = altToken ?? session.accessToken;\n\treturn {\n\t\t// pass original token info to form the correlated microhash\n\t\t...toTokenInfo(providerId, sessionToken, sessionInfo),\n\t\t// use the actual token used for the request\n\t\taccessToken: accessToken,\n\t\tconnectionId: session.id,\n\t};\n}\n\nexport type TokenOptInfo<T extends IntegrationIds = IntegrationIds> =\n\t| TokenWithInfo<T>\n\t// `connectionId` targets a specific connection (multi-account) when the token still has to be resolved.\n\t// Omitted resolves the provider's primary connection, preserving the pre-multi-account behavior.\n\t| { providerId: T; accessToken?: undefined; connectionId?: string };\n\nexport interface ConfiguredIntegrationDescriptor {\n\t/**\n\t * Stable per-connection identifier, distinct from the domain, so multiple accounts can be\n\t * connected to the same provider+domain simultaneously. For legacy/migrated single connections\n\t * this is the domain (self-managed) or the provider's canonical domain (cloud), which keeps the\n\t * existing secret key (`integration.auth[.cloud]:{id}|{domain}`) valid with zero migration.\n\t */\n\treadonly id: string;\n\t/**\n\t * Whether this is the connection used by default for the provider. Optional: when no descriptor\n\t * for a provider+domain carries an explicit flag, the first one is treated as primary. Only\n\t * {@link ConfiguredIntegrationService.setPrimaryConnection} sets the flag (and clears it on siblings).\n\t */\n\treadonly primary?: boolean;\n\t/** The connection's auth type (`oauth`/`pat`), when known. */\n\treadonly type?: CloudIntegrationAuthType;\n\t/**\n\t * Human-readable account handle for this connection (e.g. the GitHub login). Resolved from the\n\t * provider API (the token backend doesn't expose it); absent until resolved or if the lookup fails.\n\t */\n\treadonly accountName?: string;\n\t/**\n\t * Workspace the connection's token was granted for (Linear), separate from the person. Resolved with the\n\t * connection's own token and kept by connection id; both are set together, or neither is.\n\t */\n\treadonly resourceName?: string;\n\treadonly resourceId?: string;\n\treadonly cloud: boolean;\n\treadonly integrationId: IntegrationIds;\n\treadonly scopes: string;\n\treadonly domain?: string;\n\t/**\n\t * The address this connection was configured with, path included — see\n\t * {@link ProviderAuthenticationSession.baseUrl}.\n\t *\n\t * Mirrored onto the descriptor so reconciliation can tell a re-pointed connection from an unchanged one\n\t * without reading its secret: {@link domain} is normalized to a bare host, so a backend connection moved\n\t * from one context path to another on the SAME host looks identical by domain alone.\n\t */\n\treadonly baseUrl?: string;\n\treadonly expiresAt?: string | Date;\n}\n\nexport interface CloudIntegrationAuthenticationSession {\n\ttype: CloudIntegrationAuthType;\n\taccessToken: string;\n\tdomain: string;\n\texpiresIn: number;\n\tscopes: string;\n\t/** Backend per-connection token identifier, when the provider-tokens backend supports multi-account. */\n\tid?: string;\n\t/** Provider app key paired with the token (e.g. Trello app key), when the backend supplies one. */\n\tappKey?: string;\n}\n\nexport interface CloudIntegrationAuthorization {\n\turl: string;\n}\n\n/** Workspace a connection's token was granted for; only ever a complete pair. */\nexport interface ConnectionResource {\n\treadonly id: string;\n\treadonly name: string;\n}\n\nexport interface CloudIntegrationConnection {\n\ttype: CloudIntegrationAuthType;\n\tprovider: CloudIntegrationType;\n\tdomain: string;\n\t/** Backend per-connection token identifier, when the provider-tokens backend supports multi-account. */\n\tid?: string;\n\t/** Whether the backend marks this connection as the primary/default for the provider. */\n\tprimary?: boolean;\n\t/** Human-readable account handle, when the backend provides it on the connection (may be absent). */\n\taccountName?: string;\n}\n\nexport type CloudIntegrationType =\n\t| 'jira'\n\t| 'jiraServer'\n\t| 'linear'\n\t| 'trello'\n\t| 'asana'\n\t| 'gitlab'\n\t| 'github'\n\t| 'bitbucket'\n\t| 'bitbucketServer'\n\t| 'azure'\n\t| 'azureDevopsServer'\n\t| 'githubEnterprise'\n\t| 'gitlabSelfHosted';\n\nexport type CloudIntegrationAuthType = 'oauth' | 'pat';\n\n/** Returns all supported cloud integration ids. */\nexport function getSupportedCloudIntegrationIds(): readonly SupportedCloudIntegrationIds[] {\n\t// Return the shared const directly (readonly so callers can't mutate it) — this runs on hot,\n\t// per-integration membership paths, so avoid allocating a fresh array per call.\n\treturn supportedOrderedCloudIntegrationIds;\n}\n\n/** Whether `id` is a supported cloud integration id. */\nexport function isSupportedCloudIntegrationId(id: string): id is SupportedCloudIntegrationIds {\n\treturn getSupportedCloudIntegrationIds().includes(id as SupportedCloudIntegrationIds);\n}\n\nexport function isIssueCloudIntegrationId(id: string): id is IssuesCloudHostIntegrationId {\n\tconst issueIds: string[] = Object.values(IssuesCloudHostIntegrationId);\n\treturn issueIds.includes(id);\n}\n\nexport const toIntegrationId: { [key in CloudIntegrationType]: IntegrationIds } = {\n\tjira: IssuesCloudHostIntegrationId.Jira,\n\tjiraServer: IssuesSelfManagedHostIntegrationId.JiraServer,\n\tlinear: IssuesCloudHostIntegrationId.Linear,\n\ttrello: IssuesCloudHostIntegrationId.Trello,\n\tasana: IssuesCloudHostIntegrationId.Asana,\n\tgitlab: GitCloudHostIntegrationId.GitLab,\n\tgithub: GitCloudHostIntegrationId.GitHub,\n\tgithubEnterprise: GitSelfManagedHostIntegrationId.CloudGitHubEnterprise,\n\tgitlabSelfHosted: GitSelfManagedHostIntegrationId.CloudGitLabSelfHosted,\n\tbitbucket: GitCloudHostIntegrationId.Bitbucket,\n\tbitbucketServer: GitSelfManagedHostIntegrationId.BitbucketServer,\n\tazure: GitCloudHostIntegrationId.AzureDevOps,\n\tazureDevopsServer: GitSelfManagedHostIntegrationId.AzureDevOpsServer,\n};\n\nexport const toCloudIntegrationType: { [key in IntegrationIds]: CloudIntegrationType | undefined } = {\n\t[IssuesCloudHostIntegrationId.Jira]: 'jira',\n\t[IssuesSelfManagedHostIntegrationId.JiraServer]: 'jiraServer',\n\t[IssuesCloudHostIntegrationId.Linear]: 'linear',\n\t[IssuesCloudHostIntegrationId.Trello]: 'trello',\n\t[IssuesCloudHostIntegrationId.Asana]: 'asana',\n\t[GitCloudHostIntegrationId.GitLab]: 'gitlab',\n\t[GitCloudHostIntegrationId.GitHub]: 'github',\n\t[GitCloudHostIntegrationId.Bitbucket]: 'bitbucket',\n\t[GitCloudHostIntegrationId.AzureDevOps]: 'azure',\n\t[GitSelfManagedHostIntegrationId.AzureDevOpsServer]: 'azureDevopsServer',\n\t[GitSelfManagedHostIntegrationId.CloudGitHubEnterprise]: 'githubEnterprise',\n\t[GitSelfManagedHostIntegrationId.CloudGitLabSelfHosted]: 'gitlabSelfHosted',\n\t[GitSelfManagedHostIntegrationId.BitbucketServer]: 'bitbucketServer',\n};\n"],"mappings":";;;AAqDA,SAAgB,mBACf,SASqB;CACrB,OAAO,WAAW,OACf,KAAA,IACA,KAAK,UAAU;EACf,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;CACT,CAAC;AACJ;AAsBA,SAAgB,YACf,YACA,aACA,MACe;CACf,OAAO;EACM;EACZ,WAAW,UAAU,aAAa,CAAC;EACnC,OAAO,KAAK;EACZ,MAAM,KAAK;EACX,QAAQ,KAAK;EACb,WAAW,KAAK;CACjB;AACD;AAEA,SAAgB,gBACf,YACA,SACA,UACmB;CACnB,MAAM,EAAE,aAAa,cAAc,GAAG,gBAAgB;CACtD,MAAM,cAAc,YAAY,QAAQ;CACxC,OAAO;EAEN,GAAG,YAAY,YAAY,cAAc,WAAW;EAEvC;EACb,cAAc,QAAQ;CACvB;AACD;;AAuGA,SAAgB,kCAA2E;CAG1F,OAAO;AACR;;AAGA,SAAgB,8BAA8B,IAAgD;CAC7F,OAAO,gCAAgC,CAAC,CAAC,SAAS,EAAkC;AACrF;AAEA,SAAgB,0BAA0B,IAAgD;CAEzF,OAD2B,OAAO,OAAO,4BAC3B,CAAC,CAAC,SAAS,EAAE;AAC5B;AAEA,MAAa,kBAAqE;CACjF,MAAA;CACA,YAAA;CACA,QAAA;CACA,QAAA;CACA,OAAA;CACA,QAAA;CACA,QAAA;CACA,kBAAA;CACA,kBAAA;CACA,WAAA;CACA,iBAAA;CACA,OAAA;CACA,mBAAA;AACD;AAEA,MAAa,yBAAwF;EAC/D,SAAA;EACY,gBAAA;EACV,WAAA;EACA,WAAA;EACD,UAAA;EACF,WAAA;EACA,WAAA;EACG,cAAA;EACE,gBAAA;EACY,wBAAA;EACI,4BAAA;EACA,6BAAA;EACN,qBAAA;AACpD"}
@@ -1,6 +1,5 @@
1
1
  import { CloudIntegrationAuthType } from "./authentication/models.js";
2
2
  //#region ../plus/integrations/src/constants.d.ts
3
- export declare const providerFanOutConcurrency = 6;
4
3
  export declare enum GitCloudHostIntegrationId {
5
4
  GitHub = "github",
6
5
  GitLab = "gitlab",
@@ -48,14 +47,6 @@ export declare const integrationIds: (IssuesSelfManagedHostIntegrationId | GitCl
48
47
  export type SupportedCloudIntegrationIds = (typeof supportedOrderedCloudIntegrationIds)[number];
49
48
  export declare function isSupportedCloudIntegrationId(id: IntegrationIds): id is SupportedCloudIntegrationIds;
50
49
  export declare function isIntegrationId(id: string): id is IntegrationIds;
51
- export type IntegrationFeatures = 'prs' | 'issues';
52
- export interface IntegrationDescriptor {
53
- id: SupportedCloudIntegrationIds;
54
- name: string;
55
- icon: string;
56
- supports: IntegrationFeatures[];
57
- requiresPro: boolean;
58
- }
59
50
  /** Stored shape of a configured-integration descriptor in workspace state. */
60
51
  export interface StoredConfiguredIntegrationDescriptor {
61
52
  /** Stable per-connection identifier. Backfilled from the domain for pre-multi-account stored data. */
@@ -83,6 +74,5 @@ export interface StoredConfiguredIntegrationDescriptor {
83
74
  }
84
75
  /** Stored shape of the `integrations:configured` storage key. */
85
76
  export type StoredIntegrationConfigurations = Record<IntegrationIds, StoredConfiguredIntegrationDescriptor[] | undefined>;
86
- export declare const supportedCloudIntegrationDescriptors: IntegrationDescriptor[];
87
77
  //#endregion
88
78
  //# sourceMappingURL=constants.d.ts.map
@@ -1,5 +1,4 @@
1
1
  //#region ../plus/integrations/src/constants.ts
2
- const providerFanOutConcurrency = 6;
3
2
  let GitCloudHostIntegrationId = /* @__PURE__ */ function(GitCloudHostIntegrationId) {
4
3
  GitCloudHostIntegrationId["GitHub"] = "github";
5
4
  GitCloudHostIntegrationId["GitLab"] = "gitlab";
@@ -74,100 +73,7 @@ function isSupportedCloudIntegrationId(id) {
74
73
  function isIntegrationId(id) {
75
74
  return integrationIds.includes(id);
76
75
  }
77
- const supportedCloudIntegrationDescriptors = [
78
- {
79
- id: "github",
80
- name: "GitHub",
81
- icon: "gl-provider-github",
82
- supports: ["prs", "issues"],
83
- requiresPro: false
84
- },
85
- {
86
- id: "cloud-github-enterprise",
87
- name: "GitHub Enterprise",
88
- icon: "gl-provider-github",
89
- supports: ["prs", "issues"],
90
- requiresPro: true
91
- },
92
- {
93
- id: "gitlab",
94
- name: "GitLab",
95
- icon: "gl-provider-gitlab",
96
- supports: ["prs", "issues"],
97
- requiresPro: false
98
- },
99
- {
100
- id: "cloud-gitlab-self-hosted",
101
- name: "GitLab Self-Hosted",
102
- icon: "gl-provider-gitlab",
103
- supports: ["prs", "issues"],
104
- requiresPro: true
105
- },
106
- {
107
- id: "azureDevOps",
108
- name: "Azure DevOps",
109
- icon: "gl-provider-azdo",
110
- supports: ["prs", "issues"],
111
- requiresPro: true
112
- },
113
- {
114
- id: "azure-devops-server",
115
- name: "Azure DevOps Server",
116
- icon: "gl-provider-azdo",
117
- supports: ["prs", "issues"],
118
- requiresPro: true
119
- },
120
- {
121
- id: "bitbucket",
122
- name: "Bitbucket",
123
- icon: "gl-provider-bitbucket",
124
- supports: ["prs", "issues"],
125
- requiresPro: false
126
- },
127
- {
128
- id: "bitbucket-server",
129
- name: "Bitbucket Data Center",
130
- icon: "gl-provider-bitbucket",
131
- supports: ["prs"],
132
- requiresPro: true
133
- },
134
- {
135
- id: "jira",
136
- name: "Jira",
137
- icon: "gl-provider-jira",
138
- supports: ["issues"],
139
- requiresPro: true
140
- },
141
- {
142
- id: "jira-server",
143
- name: "Jira Data Center",
144
- icon: "gl-provider-jira",
145
- supports: ["issues"],
146
- requiresPro: true
147
- },
148
- {
149
- id: "linear",
150
- name: "Linear",
151
- icon: "gl-provider-linear",
152
- supports: ["issues"],
153
- requiresPro: true
154
- },
155
- {
156
- id: "trello",
157
- name: "Trello",
158
- icon: "gl-provider-trello",
159
- supports: ["issues"],
160
- requiresPro: true
161
- },
162
- {
163
- id: "asana",
164
- name: "Asana",
165
- icon: "gl-provider-asana",
166
- supports: ["issues"],
167
- requiresPro: true
168
- }
169
- ];
170
76
  //#endregion
171
- export { GitCloudHostIntegrationId, GitSelfManagedHostIntegrationId, IssuesCloudHostIntegrationId, IssuesSelfManagedHostIntegrationId, integrationIds, isIntegrationId, isSupportedCloudIntegrationId, providerFanOutConcurrency, supportedCloudIntegrationDescriptors, supportedOrderedCloudIntegrationIds, supportedOrderedCloudIssuesIntegrationIds };
77
+ export { GitCloudHostIntegrationId, GitSelfManagedHostIntegrationId, IssuesCloudHostIntegrationId, IssuesSelfManagedHostIntegrationId, integrationIds, isIntegrationId, isSupportedCloudIntegrationId, supportedOrderedCloudIntegrationIds, supportedOrderedCloudIssuesIntegrationIds };
172
78
 
173
79
  //# sourceMappingURL=constants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","names":[],"sources":["../../../../plus/integrations/src/constants.ts"],"sourcesContent":["import type { CloudIntegrationAuthType } from './authentication/models.js';\n\nexport const providerFanOutConcurrency = 6;\n\nexport enum GitCloudHostIntegrationId {\n\tGitHub = 'github',\n\tGitLab = 'gitlab',\n\tBitbucket = 'bitbucket',\n\tAzureDevOps = 'azureDevOps',\n}\n\nexport enum GitSelfManagedHostIntegrationId {\n\tBitbucketServer = 'bitbucket-server',\n\tCloudGitHubEnterprise = 'cloud-github-enterprise',\n\tCloudGitLabSelfHosted = 'cloud-gitlab-self-hosted',\n\tAzureDevOpsServer = 'azure-devops-server',\n}\n\nexport enum IssuesCloudHostIntegrationId {\n\tJira = 'jira',\n\tLinear = 'linear',\n\tTrello = 'trello',\n\tAsana = 'asana',\n}\n\n/**\n * Issue trackers that live on a customer-run host rather than a single cloud endpoint, so every read must be\n * routed by the connection's own domain. Separate from {@link GitSelfManagedHostIntegrationId} because a\n * tracker has no repositories or pull requests: the two enums differ in what the id can be ASKED for, while\n * what they share — being keyed by host — is expressed by {@link SelfManagedHostIntegrationIds} and the\n * `isSelfManagedHostIntegrationId` predicate.\n */\nexport enum IssuesSelfManagedHostIntegrationId {\n\tJiraServer = 'jira-server',\n}\n\nexport type CloudGitSelfManagedHostIntegrationIds =\n\t| GitSelfManagedHostIntegrationId.CloudGitHubEnterprise\n\t| GitSelfManagedHostIntegrationId.BitbucketServer\n\t| GitSelfManagedHostIntegrationId.AzureDevOpsServer\n\t| GitSelfManagedHostIntegrationId.CloudGitLabSelfHosted;\n\n/** The self-managed ids whose tokens are issued by the GK cloud backend, whatever they host. */\nexport type CloudSelfManagedHostIntegrationIds =\n\t| CloudGitSelfManagedHostIntegrationIds\n\t| IssuesSelfManagedHostIntegrationId.JiraServer;\n\nexport type GitHostIntegrationIds = GitCloudHostIntegrationId | GitSelfManagedHostIntegrationId;\nexport type IssuesHostIntegrationIds = IssuesCloudHostIntegrationId | IssuesSelfManagedHostIntegrationId;\n\n/** Every id addressed by host, across both families — what the domain-keyed machinery keys off. */\nexport type SelfManagedHostIntegrationIds = GitSelfManagedHostIntegrationId | IssuesSelfManagedHostIntegrationId;\n\nexport type IntegrationIds = GitHostIntegrationIds | IssuesHostIntegrationIds;\n\nexport const supportedOrderedCloudIntegrationIds = [\n\tGitCloudHostIntegrationId.GitHub,\n\tGitSelfManagedHostIntegrationId.CloudGitHubEnterprise,\n\tGitCloudHostIntegrationId.GitLab,\n\tGitSelfManagedHostIntegrationId.CloudGitLabSelfHosted,\n\tGitCloudHostIntegrationId.AzureDevOps,\n\tGitSelfManagedHostIntegrationId.AzureDevOpsServer,\n\tGitCloudHostIntegrationId.Bitbucket,\n\tGitSelfManagedHostIntegrationId.BitbucketServer,\n\tIssuesCloudHostIntegrationId.Jira,\n\tIssuesSelfManagedHostIntegrationId.JiraServer,\n\tIssuesCloudHostIntegrationId.Linear,\n\tIssuesCloudHostIntegrationId.Trello,\n\tIssuesCloudHostIntegrationId.Asana,\n];\n\n/**\n * The issue trackers of {@link supportedOrderedCloudIntegrationIds}, in the same order. Derived rather than\n * listed again: the two were parallel literals, and an id added to one and forgotten in the other drops that\n * tracker out of default project discovery and the Graph's issue-integration check with no other symptom.\n */\nexport const supportedOrderedCloudIssuesIntegrationIds = supportedOrderedCloudIntegrationIds.filter(\n\t(id): id is IssuesHostIntegrationIds =>\n\t\t// `Object.values`, not `in`: these are string enums, so the object is keyed by member name and `in`\n\t\t// would test the id against `Jira`/`Linear` rather than against `jira`/`linear`.\n\t\t(Object.values(IssuesCloudHostIntegrationId) as IntegrationIds[]).includes(id) ||\n\t\t(Object.values(IssuesSelfManagedHostIntegrationId) as IntegrationIds[]).includes(id),\n);\n\nexport const integrationIds = [\n\tGitCloudHostIntegrationId.GitHub,\n\tGitCloudHostIntegrationId.GitLab,\n\tGitCloudHostIntegrationId.Bitbucket,\n\tGitCloudHostIntegrationId.AzureDevOps,\n\tGitSelfManagedHostIntegrationId.AzureDevOpsServer,\n\tGitSelfManagedHostIntegrationId.BitbucketServer,\n\tGitSelfManagedHostIntegrationId.CloudGitHubEnterprise,\n\tGitSelfManagedHostIntegrationId.CloudGitLabSelfHosted,\n\tIssuesCloudHostIntegrationId.Jira,\n\tIssuesSelfManagedHostIntegrationId.JiraServer,\n\tIssuesCloudHostIntegrationId.Linear,\n\tIssuesCloudHostIntegrationId.Trello,\n\tIssuesCloudHostIntegrationId.Asana,\n];\n\nexport type SupportedCloudIntegrationIds = (typeof supportedOrderedCloudIntegrationIds)[number];\n\nexport function isSupportedCloudIntegrationId(id: IntegrationIds): id is SupportedCloudIntegrationIds {\n\treturn supportedOrderedCloudIntegrationIds.includes(id);\n}\n\nexport function isIntegrationId(id: string): id is IntegrationIds {\n\treturn integrationIds.includes(id as IntegrationIds);\n}\n\nexport type IntegrationFeatures = 'prs' | 'issues';\n\nexport interface IntegrationDescriptor {\n\tid: SupportedCloudIntegrationIds;\n\tname: string;\n\ticon: string;\n\tsupports: IntegrationFeatures[];\n\trequiresPro: boolean;\n}\n\n/** Stored shape of a configured-integration descriptor in workspace state. */\nexport interface StoredConfiguredIntegrationDescriptor {\n\t/** Stable per-connection identifier. Backfilled from the domain for pre-multi-account stored data. */\n\tid?: string;\n\t/** Whether this is the primary/default connection for the provider. */\n\tprimary?: boolean;\n\t/** The connection's auth type (`oauth`/`pat`), when known. */\n\ttype?: CloudIntegrationAuthType;\n\t/** Human-readable account handle for this connection (e.g. the GitHub login), when resolved. */\n\taccountName?: string;\n\t/** Workspace the token was granted for (Linear), separate from the person; set with {@link resourceId}. */\n\tresourceName?: string;\n\t/** Id of that workspace; set with {@link resourceName}, or neither is. */\n\tresourceId?: string;\n\tcloud: boolean;\n\tintegrationId: IntegrationIds;\n\tdomain?: string;\n\t/**\n\t * The address a self-managed connection was configured with, path included, when it differs from the\n\t * host-normalized {@link domain} — see `ProviderAuthenticationSession.baseUrl`.\n\t */\n\tbaseUrl?: string;\n\texpiresAt?: string;\n\tscopes: string;\n}\n\n/** Stored shape of the `integrations:configured` storage key. */\nexport type StoredIntegrationConfigurations = Record<\n\tIntegrationIds,\n\tStoredConfiguredIntegrationDescriptor[] | undefined\n>;\n\nexport const supportedCloudIntegrationDescriptors: IntegrationDescriptor[] = [\n\t{\n\t\tid: GitCloudHostIntegrationId.GitHub,\n\t\tname: 'GitHub',\n\t\ticon: 'gl-provider-github',\n\t\tsupports: ['prs', 'issues'],\n\t\trequiresPro: false,\n\t},\n\t{\n\t\tid: GitSelfManagedHostIntegrationId.CloudGitHubEnterprise,\n\t\tname: 'GitHub Enterprise',\n\t\ticon: 'gl-provider-github',\n\t\tsupports: ['prs', 'issues'],\n\t\trequiresPro: true,\n\t},\n\t{\n\t\tid: GitCloudHostIntegrationId.GitLab,\n\t\tname: 'GitLab',\n\t\ticon: 'gl-provider-gitlab',\n\t\tsupports: ['prs', 'issues'],\n\t\trequiresPro: false,\n\t},\n\t{\n\t\tid: GitSelfManagedHostIntegrationId.CloudGitLabSelfHosted,\n\t\tname: 'GitLab Self-Hosted',\n\t\ticon: 'gl-provider-gitlab',\n\t\tsupports: ['prs', 'issues'],\n\t\trequiresPro: true,\n\t},\n\t{\n\t\tid: GitCloudHostIntegrationId.AzureDevOps,\n\t\tname: 'Azure DevOps',\n\t\ticon: 'gl-provider-azdo',\n\t\tsupports: ['prs', 'issues'],\n\t\trequiresPro: true,\n\t},\n\t{\n\t\tid: GitSelfManagedHostIntegrationId.AzureDevOpsServer,\n\t\tname: 'Azure DevOps Server',\n\t\ticon: 'gl-provider-azdo',\n\t\tsupports: ['prs', 'issues'],\n\t\trequiresPro: true,\n\t},\n\t{\n\t\tid: GitCloudHostIntegrationId.Bitbucket,\n\t\tname: 'Bitbucket',\n\t\ticon: 'gl-provider-bitbucket',\n\t\tsupports: ['prs', 'issues'],\n\t\trequiresPro: false,\n\t},\n\t{\n\t\tid: GitSelfManagedHostIntegrationId.BitbucketServer,\n\t\tname: 'Bitbucket Data Center',\n\t\ticon: 'gl-provider-bitbucket',\n\t\tsupports: ['prs'],\n\t\trequiresPro: true,\n\t},\n\t{\n\t\tid: IssuesCloudHostIntegrationId.Jira,\n\t\tname: 'Jira',\n\t\ticon: 'gl-provider-jira',\n\t\tsupports: ['issues'],\n\t\trequiresPro: true,\n\t},\n\t{\n\t\tid: IssuesSelfManagedHostIntegrationId.JiraServer,\n\t\tname: 'Jira Data Center',\n\t\ticon: 'gl-provider-jira',\n\t\tsupports: ['issues'],\n\t\trequiresPro: true,\n\t},\n\t{\n\t\tid: IssuesCloudHostIntegrationId.Linear,\n\t\tname: 'Linear',\n\t\ticon: 'gl-provider-linear',\n\t\tsupports: ['issues'],\n\t\trequiresPro: true,\n\t},\n\t{\n\t\tid: IssuesCloudHostIntegrationId.Trello,\n\t\tname: 'Trello',\n\t\ticon: 'gl-provider-trello',\n\t\tsupports: ['issues'],\n\t\trequiresPro: true,\n\t},\n\t{\n\t\tid: IssuesCloudHostIntegrationId.Asana,\n\t\tname: 'Asana',\n\t\ticon: 'gl-provider-asana',\n\t\tsupports: ['issues'],\n\t\trequiresPro: true,\n\t},\n];\n"],"mappings":";AAEA,MAAa,4BAA4B;AAEzC,IAAY,4BAAL,yBAAA,2BAAA;CACN,0BAAA,YAAA;CACA,0BAAA,YAAA;CACA,0BAAA,eAAA;CACA,0BAAA,iBAAA;;AACD,EAAA,CAAA,CAAA;AAEA,IAAY,kCAAL,yBAAA,iCAAA;CACN,gCAAA,qBAAA;CACA,gCAAA,2BAAA;CACA,gCAAA,2BAAA;CACA,gCAAA,uBAAA;;AACD,EAAA,CAAA,CAAA;AAEA,IAAY,+BAAL,yBAAA,8BAAA;CACN,6BAAA,UAAA;CACA,6BAAA,YAAA;CACA,6BAAA,YAAA;CACA,6BAAA,WAAA;;AACD,EAAA,CAAA,CAAA;;;;;;;;AASA,IAAY,qCAAL,yBAAA,oCAAA;CACN,mCAAA,gBAAA;;AACD,EAAA,CAAA,CAAA;AAqBA,MAAa,sCAAsC;;;;;;;;;;;;;;AAcnD;;;;;;AAOA,MAAa,4CAA4C,oCAAoC,QAC3F,OAGC,OAAO,OAAO,4BAA4B,CAAC,CAAsB,SAAS,EAAE,KAC5E,OAAO,OAAO,kCAAkC,CAAC,CAAsB,SAAS,EAAE,CACrF;AAEA,MAAa,iBAAiB;;;;;;;;;;;;;;AAc9B;AAIA,SAAgB,8BAA8B,IAAwD;CACrG,OAAO,oCAAoC,SAAS,EAAE;AACvD;AAEA,SAAgB,gBAAgB,IAAkC;CACjE,OAAO,eAAe,SAAS,EAAoB;AACpD;AA4CA,MAAa,uCAAgE;CAC5E;EACC,IAAA;EACA,MAAM;EACN,MAAM;EACN,UAAU,CAAC,OAAO,QAAQ;EAC1B,aAAa;CACd;CACA;EACC,IAAA;EACA,MAAM;EACN,MAAM;EACN,UAAU,CAAC,OAAO,QAAQ;EAC1B,aAAa;CACd;CACA;EACC,IAAA;EACA,MAAM;EACN,MAAM;EACN,UAAU,CAAC,OAAO,QAAQ;EAC1B,aAAa;CACd;CACA;EACC,IAAA;EACA,MAAM;EACN,MAAM;EACN,UAAU,CAAC,OAAO,QAAQ;EAC1B,aAAa;CACd;CACA;EACC,IAAA;EACA,MAAM;EACN,MAAM;EACN,UAAU,CAAC,OAAO,QAAQ;EAC1B,aAAa;CACd;CACA;EACC,IAAA;EACA,MAAM;EACN,MAAM;EACN,UAAU,CAAC,OAAO,QAAQ;EAC1B,aAAa;CACd;CACA;EACC,IAAA;EACA,MAAM;EACN,MAAM;EACN,UAAU,CAAC,OAAO,QAAQ;EAC1B,aAAa;CACd;CACA;EACC,IAAA;EACA,MAAM;EACN,MAAM;EACN,UAAU,CAAC,KAAK;EAChB,aAAa;CACd;CACA;EACC,IAAA;EACA,MAAM;EACN,MAAM;EACN,UAAU,CAAC,QAAQ;EACnB,aAAa;CACd;CACA;EACC,IAAA;EACA,MAAM;EACN,MAAM;EACN,UAAU,CAAC,QAAQ;EACnB,aAAa;CACd;CACA;EACC,IAAA;EACA,MAAM;EACN,MAAM;EACN,UAAU,CAAC,QAAQ;EACnB,aAAa;CACd;CACA;EACC,IAAA;EACA,MAAM;EACN,MAAM;EACN,UAAU,CAAC,QAAQ;EACnB,aAAa;CACd;CACA;EACC,IAAA;EACA,MAAM;EACN,MAAM;EACN,UAAU,CAAC,QAAQ;EACnB,aAAa;CACd;AACD"}
1
+ {"version":3,"file":"constants.js","names":[],"sources":["../../../../plus/integrations/src/constants.ts"],"sourcesContent":["// Webviews import this module directly, so it must stay free of runtime imports (type-only imports are fine).\nimport type { CloudIntegrationAuthType } from './authentication/models.js';\n\nexport enum GitCloudHostIntegrationId {\n\tGitHub = 'github',\n\tGitLab = 'gitlab',\n\tBitbucket = 'bitbucket',\n\tAzureDevOps = 'azureDevOps',\n}\n\nexport enum GitSelfManagedHostIntegrationId {\n\tBitbucketServer = 'bitbucket-server',\n\tCloudGitHubEnterprise = 'cloud-github-enterprise',\n\tCloudGitLabSelfHosted = 'cloud-gitlab-self-hosted',\n\tAzureDevOpsServer = 'azure-devops-server',\n}\n\nexport enum IssuesCloudHostIntegrationId {\n\tJira = 'jira',\n\tLinear = 'linear',\n\tTrello = 'trello',\n\tAsana = 'asana',\n}\n\n/**\n * Issue trackers that live on a customer-run host rather than a single cloud endpoint, so every read must be\n * routed by the connection's own domain. Separate from {@link GitSelfManagedHostIntegrationId} because a\n * tracker has no repositories or pull requests: the two enums differ in what the id can be ASKED for, while\n * what they share — being keyed by host — is expressed by {@link SelfManagedHostIntegrationIds} and the\n * `isSelfManagedHostIntegrationId` predicate.\n */\nexport enum IssuesSelfManagedHostIntegrationId {\n\tJiraServer = 'jira-server',\n}\n\nexport type CloudGitSelfManagedHostIntegrationIds =\n\t| GitSelfManagedHostIntegrationId.CloudGitHubEnterprise\n\t| GitSelfManagedHostIntegrationId.BitbucketServer\n\t| GitSelfManagedHostIntegrationId.AzureDevOpsServer\n\t| GitSelfManagedHostIntegrationId.CloudGitLabSelfHosted;\n\n/** The self-managed ids whose tokens are issued by the GK cloud backend, whatever they host. */\nexport type CloudSelfManagedHostIntegrationIds =\n\t| CloudGitSelfManagedHostIntegrationIds\n\t| IssuesSelfManagedHostIntegrationId.JiraServer;\n\nexport type GitHostIntegrationIds = GitCloudHostIntegrationId | GitSelfManagedHostIntegrationId;\nexport type IssuesHostIntegrationIds = IssuesCloudHostIntegrationId | IssuesSelfManagedHostIntegrationId;\n\n/** Every id addressed by host, across both families — what the domain-keyed machinery keys off. */\nexport type SelfManagedHostIntegrationIds = GitSelfManagedHostIntegrationId | IssuesSelfManagedHostIntegrationId;\n\nexport type IntegrationIds = GitHostIntegrationIds | IssuesHostIntegrationIds;\n\nexport const supportedOrderedCloudIntegrationIds = [\n\tGitCloudHostIntegrationId.GitHub,\n\tGitSelfManagedHostIntegrationId.CloudGitHubEnterprise,\n\tGitCloudHostIntegrationId.GitLab,\n\tGitSelfManagedHostIntegrationId.CloudGitLabSelfHosted,\n\tGitCloudHostIntegrationId.AzureDevOps,\n\tGitSelfManagedHostIntegrationId.AzureDevOpsServer,\n\tGitCloudHostIntegrationId.Bitbucket,\n\tGitSelfManagedHostIntegrationId.BitbucketServer,\n\tIssuesCloudHostIntegrationId.Jira,\n\tIssuesSelfManagedHostIntegrationId.JiraServer,\n\tIssuesCloudHostIntegrationId.Linear,\n\tIssuesCloudHostIntegrationId.Trello,\n\tIssuesCloudHostIntegrationId.Asana,\n];\n\n/**\n * The issue trackers of {@link supportedOrderedCloudIntegrationIds}, in the same order. Derived rather than\n * listed again: the two were parallel literals, and an id added to one and forgotten in the other drops that\n * tracker out of default project discovery and the Graph's issue-integration check with no other symptom.\n */\nexport const supportedOrderedCloudIssuesIntegrationIds = supportedOrderedCloudIntegrationIds.filter(\n\t(id): id is IssuesHostIntegrationIds =>\n\t\t// `Object.values`, not `in`: these are string enums, so the object is keyed by member name and `in`\n\t\t// would test the id against `Jira`/`Linear` rather than against `jira`/`linear`.\n\t\t(Object.values(IssuesCloudHostIntegrationId) as IntegrationIds[]).includes(id) ||\n\t\t(Object.values(IssuesSelfManagedHostIntegrationId) as IntegrationIds[]).includes(id),\n);\n\nexport const integrationIds = [\n\tGitCloudHostIntegrationId.GitHub,\n\tGitCloudHostIntegrationId.GitLab,\n\tGitCloudHostIntegrationId.Bitbucket,\n\tGitCloudHostIntegrationId.AzureDevOps,\n\tGitSelfManagedHostIntegrationId.AzureDevOpsServer,\n\tGitSelfManagedHostIntegrationId.BitbucketServer,\n\tGitSelfManagedHostIntegrationId.CloudGitHubEnterprise,\n\tGitSelfManagedHostIntegrationId.CloudGitLabSelfHosted,\n\tIssuesCloudHostIntegrationId.Jira,\n\tIssuesSelfManagedHostIntegrationId.JiraServer,\n\tIssuesCloudHostIntegrationId.Linear,\n\tIssuesCloudHostIntegrationId.Trello,\n\tIssuesCloudHostIntegrationId.Asana,\n];\n\nexport type SupportedCloudIntegrationIds = (typeof supportedOrderedCloudIntegrationIds)[number];\n\nexport function isSupportedCloudIntegrationId(id: IntegrationIds): id is SupportedCloudIntegrationIds {\n\treturn supportedOrderedCloudIntegrationIds.includes(id);\n}\n\nexport function isIntegrationId(id: string): id is IntegrationIds {\n\treturn integrationIds.includes(id as IntegrationIds);\n}\n\n/** Stored shape of a configured-integration descriptor in workspace state. */\nexport interface StoredConfiguredIntegrationDescriptor {\n\t/** Stable per-connection identifier. Backfilled from the domain for pre-multi-account stored data. */\n\tid?: string;\n\t/** Whether this is the primary/default connection for the provider. */\n\tprimary?: boolean;\n\t/** The connection's auth type (`oauth`/`pat`), when known. */\n\ttype?: CloudIntegrationAuthType;\n\t/** Human-readable account handle for this connection (e.g. the GitHub login), when resolved. */\n\taccountName?: string;\n\t/** Workspace the token was granted for (Linear), separate from the person; set with {@link resourceId}. */\n\tresourceName?: string;\n\t/** Id of that workspace; set with {@link resourceName}, or neither is. */\n\tresourceId?: string;\n\tcloud: boolean;\n\tintegrationId: IntegrationIds;\n\tdomain?: string;\n\t/**\n\t * The address a self-managed connection was configured with, path included, when it differs from the\n\t * host-normalized {@link domain} — see `ProviderAuthenticationSession.baseUrl`.\n\t */\n\tbaseUrl?: string;\n\texpiresAt?: string;\n\tscopes: string;\n}\n\n/** Stored shape of the `integrations:configured` storage key. */\nexport type StoredIntegrationConfigurations = Record<\n\tIntegrationIds,\n\tStoredConfiguredIntegrationDescriptor[] | undefined\n>;\n"],"mappings":";AAGA,IAAY,4BAAL,yBAAA,2BAAA;CACN,0BAAA,YAAA;CACA,0BAAA,YAAA;CACA,0BAAA,eAAA;CACA,0BAAA,iBAAA;;AACD,EAAA,CAAA,CAAA;AAEA,IAAY,kCAAL,yBAAA,iCAAA;CACN,gCAAA,qBAAA;CACA,gCAAA,2BAAA;CACA,gCAAA,2BAAA;CACA,gCAAA,uBAAA;;AACD,EAAA,CAAA,CAAA;AAEA,IAAY,+BAAL,yBAAA,8BAAA;CACN,6BAAA,UAAA;CACA,6BAAA,YAAA;CACA,6BAAA,YAAA;CACA,6BAAA,WAAA;;AACD,EAAA,CAAA,CAAA;;;;;;;;AASA,IAAY,qCAAL,yBAAA,oCAAA;CACN,mCAAA,gBAAA;;AACD,EAAA,CAAA,CAAA;AAqBA,MAAa,sCAAsC;;;;;;;;;;;;;;AAcnD;;;;;;AAOA,MAAa,4CAA4C,oCAAoC,QAC3F,OAGC,OAAO,OAAO,4BAA4B,CAAC,CAAsB,SAAS,EAAE,KAC5E,OAAO,OAAO,kCAAkC,CAAC,CAAsB,SAAS,EAAE,CACrF;AAEA,MAAa,iBAAiB;;;;;;;;;;;;;;AAc9B;AAIA,SAAgB,8BAA8B,IAAwD;CACrG,OAAO,oCAAoC,SAAS,EAAE;AACvD;AAEA,SAAgB,gBAAgB,IAAkC;CACjE,OAAO,eAAe,SAAS,EAAoB;AACpD"}