@gitkraken/core-gitlens 0.38.2 → 0.38.4

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 (56) hide show
  1. package/CHANGELOG.md +24 -1
  2. package/dist/git/parsers/diffParser.d.ts +25 -0
  3. package/dist/git/parsers/diffParser.js +169 -23
  4. package/dist/git/parsers/diffParser.js.map +1 -1
  5. package/dist/git/providers/diff.d.ts +10 -0
  6. package/dist/git/providers/revision.d.ts +8 -1
  7. package/dist/git-cli/parsers/blameParser.js +25 -5
  8. package/dist/git-cli/parsers/blameParser.js.map +1 -1
  9. package/dist/git-cli/parsers/logParser.js +28 -18
  10. package/dist/git-cli/parsers/logParser.js.map +1 -1
  11. package/dist/git-cli/parsers/statusParser.d.ts +5 -1
  12. package/dist/git-cli/parsers/statusParser.js +17 -6
  13. package/dist/git-cli/parsers/statusParser.js.map +1 -1
  14. package/dist/git-cli/parsers/treeParser.js +5 -3
  15. package/dist/git-cli/parsers/treeParser.js.map +1 -1
  16. package/dist/git-cli/parsers/worktreeParser.js +1 -41
  17. package/dist/git-cli/parsers/worktreeParser.js.map +1 -1
  18. package/dist/git-cli/providers/diff.d.ts +2 -0
  19. package/dist/git-cli/providers/diff.js +10 -7
  20. package/dist/git-cli/providers/diff.js.map +1 -1
  21. package/dist/git-cli/providers/revision.d.ts +3 -1
  22. package/dist/git-cli/providers/revision.js +10 -5
  23. package/dist/git-cli/providers/revision.js.map +1 -1
  24. package/dist/git-cli/providers/status.js +1 -0
  25. package/dist/git-cli/providers/status.js.map +1 -1
  26. package/dist/plus/git-github/providers/github/revision.d.ts +3 -1
  27. package/dist/plus/git-github/providers/github/revision.js +1 -1
  28. package/dist/plus/git-github/providers/github/revision.js.map +1 -1
  29. package/dist/plus/integrations/authentication/configuredIntegrationService.d.ts +2 -0
  30. package/dist/plus/integrations/authentication/configuredIntegrationService.js +23 -1
  31. package/dist/plus/integrations/authentication/configuredIntegrationService.js.map +1 -1
  32. package/dist/plus/integrations/authentication/models.d.ts +1 -0
  33. package/dist/plus/integrations/authentication/models.js.map +1 -1
  34. package/dist/plus/integrations/authentication/observedAuthenticationProvider.js +4 -1
  35. package/dist/plus/integrations/authentication/observedAuthenticationProvider.js.map +1 -1
  36. package/dist/plus/integrations/integrationService.js +7 -1
  37. package/dist/plus/integrations/integrationService.js.map +1 -1
  38. package/dist/plus/integrations/models/integration.d.ts +1 -0
  39. package/dist/plus/integrations/models/integration.js +8 -0
  40. package/dist/plus/integrations/models/integration.js.map +1 -1
  41. package/dist/plus/integrations/models/issuesIntegration.d.ts +5 -0
  42. package/dist/plus/integrations/models/issuesIntegration.js +33 -1
  43. package/dist/plus/integrations/models/issuesIntegration.js.map +1 -1
  44. package/dist/plus/integrations/providers/jira.d.ts +3 -2
  45. package/dist/plus/integrations/providers/jira.js +36 -17
  46. package/dist/plus/integrations/providers/jira.js.map +1 -1
  47. package/dist/plus/integrations/providers/linear.d.ts +1 -0
  48. package/dist/plus/integrations/providers/linear.js +40 -17
  49. package/dist/plus/integrations/providers/linear.js.map +1 -1
  50. package/dist/plus/integrations/providers/utils/discoveryCache.d.ts +6 -3
  51. package/dist/plus/integrations/providers/utils/discoveryCache.js +12 -6
  52. package/dist/plus/integrations/providers/utils/discoveryCache.js.map +1 -1
  53. package/dist/utils/string.d.ts +15 -0
  54. package/dist/utils/string.js +61 -1
  55. package/dist/utils/string.js.map +1 -1
  56. package/package.json +1 -1
@@ -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};\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":";;;AAoDA,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\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"}
@@ -199,7 +199,10 @@ var ObservedAuthenticationProvider = class {
199
199
  replacePrimary: target.connectionId == null
200
200
  }, [target.descriptorDomain, target.actualDomain]);
201
201
  }
202
- if (targets.length === 0) this.publish({ replacePrimary: true }, [domain]);
202
+ this.publish({
203
+ replacePrimary: true,
204
+ retireAll: true
205
+ }, [domain]);
203
206
  this.removeTargets(targets);
204
207
  this.markRetirement(retirement);
205
208
  return retirement;
@@ -1 +1 @@
1
- {"version":3,"file":"observedAuthenticationProvider.js","names":[],"sources":["../../../../../plus/integrations/src/authentication/observedAuthenticationProvider.ts"],"sourcesContent":["import { CancellationError } from '@gitlens/utils/cancellation.js';\nimport type { Event } from '@gitlens/utils/event.js';\nimport { areDomainsOnSameHost, hostFromDomain } from '../utils/domain.utils.js';\nimport type {\n\tGetSessionOptions,\n\tIntegrationAuthenticationProvider,\n\tIntegrationAuthenticationSessionDescriptor,\n} from './integrationAuthenticationProvider.js';\nimport type { ProviderAuthenticationSession, SessionPublication } from './models.js';\nimport { getSessionIdentity } from './models.js';\n\ntype Observation = {\n\trequest: number;\n\tidentity: string | undefined;\n\tdescriptorDomain: string;\n\tactualDomain: string;\n\tcloud: boolean | undefined;\n\tsessionKey?: string;\n\tsessionId?: string;\n\tconnectionId?: string;\n};\n\ntype Retirement = {\n\tdescriptors: Set<string>;\n\tactuals: Set<string>;\n\thost?: string;\n\tall?: boolean;\n};\n\nfunction domainKey(domain: string): string {\n\treturn hostFromDomain(domain) ?? domain;\n}\n\nfunction descriptorKey(domain: string, connectionId: string | undefined, cloud: boolean | undefined): string {\n\treturn JSON.stringify([domainKey(domain), connectionId, cloud]);\n}\n\nfunction actualKey(domain: string, id: string, cloud: boolean | undefined): string {\n\treturn JSON.stringify([domainKey(domain), id, cloud]);\n}\n\nexport class ObservedAuthenticationProvider implements IntegrationAuthenticationProvider {\n\tprivate readonly observations = new Map<string, Observation>();\n\tprivate readonly credentials = new Map<string, Observation>();\n\tprivate readonly descriptorRetirements = new Map<string, number>();\n\tprivate readonly actualRetirements = new Map<string, number>();\n\tprivate readonly hostRetirements = new Map<string, number>();\n\tprivate readonly activeRetirements = new Set<Retirement>();\n\tprivate sequence = 0;\n\tprivate globalRetirement = 0;\n\tprivate disposed = false;\n\n\tconstructor(\n\t\tprivate readonly host: IntegrationAuthenticationProvider,\n\t\tprivate readonly selfManaged: boolean,\n\t\tprivate readonly publish: (publication: SessionPublication, domains: (string | undefined)[]) => void,\n\t) {}\n\n\tget onDidChange(): Event<void> {\n\t\treturn this.host.onDidChange;\n\t}\n\n\tasync getSession(\n\t\tdescriptor: IntegrationAuthenticationSessionDescriptor,\n\t\toptions?: GetSessionOptions,\n\t): Promise<ProviderAuthenticationSession | undefined> {\n\t\tif (this.disposed) return undefined;\n\n\t\tconst request = ++this.sequence;\n\t\tconst scope = JSON.stringify([\n\t\t\tdescriptor.connectionId,\n\t\t\tdomainKey(descriptor.domain),\n\t\t\tdescriptor.cloud,\n\t\t\tdescriptor.scopes,\n\t\t]);\n\t\tconst source = await this.host.getSession(descriptor, options);\n\t\tif (source != null && this.selfManaged && !areDomainsOnSameHost(descriptor.domain, source.domain)) {\n\t\t\tthrow new CancellationError();\n\t\t}\n\t\tif (this.isRetired(request, descriptor, source)) throw new CancellationError();\n\n\t\tconst identity = getSessionIdentity(source);\n\t\tconst previous = this.observations.get(scope);\n\t\tconst sessionKey =\n\t\t\tsource == null\n\t\t\t\t? (previous?.sessionKey ??\n\t\t\t\t\t(descriptor.connectionId\n\t\t\t\t\t\t? actualKey(descriptor.domain, descriptor.connectionId, descriptor.cloud ?? true)\n\t\t\t\t\t\t: undefined))\n\t\t\t\t: actualKey(source.domain || descriptor.domain, source.id, source.cloud);\n\t\tconst credential = sessionKey == null ? undefined : this.credentials.get(sessionKey);\n\t\tconst latest =\n\t\t\tcredential != null && (previous == null || credential.request > previous.request) ? credential : previous;\n\t\tif (latest != null && latest.request > request && latest.identity !== identity) {\n\t\t\tthrow new CancellationError();\n\t\t}\n\n\t\tconst session: ProviderAuthenticationSession | undefined =\n\t\t\tsource == null\n\t\t\t\t? undefined\n\t\t\t\t: {\n\t\t\t\t\t\tid: source.id,\n\t\t\t\t\t\taccessToken: source.accessToken,\n\t\t\t\t\t\taccount: source.account,\n\t\t\t\t\t\tscopes: source.scopes,\n\t\t\t\t\t\tcloud: source.cloud,\n\t\t\t\t\t\ttype: source.type,\n\t\t\t\t\t\texpiresAt: source.expiresAt,\n\t\t\t\t\t\tdomain: source.domain,\n\t\t\t\t\t\tbaseUrl: source.baseUrl,\n\t\t\t\t\t\tprotocol: source.protocol,\n\t\t\t\t\t\tappKey: source.appKey,\n\t\t\t\t\t};\n\t\tif (latest == null || latest.request <= request) {\n\t\t\tif (previous == null || previous.identity !== identity || credential?.identity !== identity) {\n\t\t\t\tthis.publish(\n\t\t\t\t\t{\n\t\t\t\t\t\tsession: session,\n\t\t\t\t\t\tpreviousSessionId: latest?.sessionId ?? descriptor.connectionId,\n\t\t\t\t\t\tconnectionId: descriptor.connectionId,\n\t\t\t\t\t\tcloud: session != null ? session.cloud : (latest?.cloud ?? descriptor.cloud),\n\t\t\t\t\t\treplacePrimary: !descriptor.connectionId,\n\t\t\t\t\t},\n\t\t\t\t\t[descriptor.domain, session?.domain, previous?.actualDomain],\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tconst observation: Observation = {\n\t\t\t\trequest: request,\n\t\t\t\tidentity: identity,\n\t\t\t\tdescriptorDomain: descriptor.domain,\n\t\t\t\tactualDomain: session?.domain || descriptor.domain,\n\t\t\t\tcloud: session?.cloud ?? descriptor.cloud,\n\t\t\t\tsessionKey: sessionKey,\n\t\t\t\tsessionId: source?.id ?? latest?.sessionId ?? descriptor.connectionId,\n\t\t\t\tconnectionId: descriptor.connectionId,\n\t\t\t};\n\t\t\tthis.observations.set(scope, observation);\n\t\t\tif (sessionKey != null) {\n\t\t\t\tthis.credentials.set(sessionKey, observation);\n\t\t\t}\n\t\t}\n\n\t\treturn session;\n\t}\n\n\tasync deleteSession(\n\t\tdescriptor: IntegrationAuthenticationSessionDescriptor,\n\t\toptions?: { preserveConfigured?: boolean },\n\t): Promise<void> {\n\t\tconst retirement = this.retireConnection(descriptor);\n\t\tthis.activeRetirements.add(retirement);\n\t\ttry {\n\t\t\tawait this.host.deleteSession(descriptor, options);\n\t\t} finally {\n\t\t\tthis.markRetirement(retirement);\n\t\t\tthis.activeRetirements.delete(retirement);\n\t\t}\n\t}\n\n\tasync deleteAllSessions(descriptor?: IntegrationAuthenticationSessionDescriptor): Promise<void> {\n\t\tconst retirement = this.retireAll(this.selfManaged ? descriptor?.domain : undefined);\n\t\tthis.activeRetirements.add(retirement);\n\t\ttry {\n\t\t\tawait this.host.deleteAllSessions(descriptor);\n\t\t} finally {\n\t\t\tthis.markRetirement(retirement);\n\t\t\tthis.activeRetirements.delete(retirement);\n\t\t}\n\t}\n\n\tdispose(): void {\n\t\tif (this.disposed) return;\n\n\t\tthis.disposed = true;\n\t\tthis.retireAll();\n\t\tthis.host.dispose();\n\t}\n\n\tprivate isRetired(\n\t\trequest: number,\n\t\tdescriptor: IntegrationAuthenticationSessionDescriptor,\n\t\tsession: ProviderAuthenticationSession | undefined,\n\t): boolean {\n\t\tif (this.disposed || request < this.globalRetirement) return true;\n\n\t\tconst host = domainKey(descriptor.domain);\n\t\tconst variants = new Set([undefined, descriptor.cloud, session?.cloud]);\n\t\tif (descriptor.cloud == null && session?.cloud == null) {\n\t\t\tvariants.add(true);\n\t\t\tvariants.add(false);\n\t\t}\n\t\tconst descriptorIdentities = Array.from(variants, cloud =>\n\t\t\tdescriptorKey(descriptor.domain, descriptor.connectionId, cloud),\n\t\t);\n\t\tconst actual =\n\t\t\tsession == null ? undefined : actualKey(session.domain || descriptor.domain, session.id, session.cloud);\n\t\tconst actualAnyVariant =\n\t\t\tsession == null ? undefined : actualKey(session.domain || descriptor.domain, session.id, undefined);\n\t\tif (\n\t\t\trequest < (this.hostRetirements.get(host) ?? 0) ||\n\t\t\tdescriptorIdentities.some(key => request < (this.descriptorRetirements.get(key) ?? 0)) ||\n\t\t\t(actual != null && request < (this.actualRetirements.get(actual) ?? 0)) ||\n\t\t\t(actualAnyVariant != null && request < (this.actualRetirements.get(actualAnyVariant) ?? 0))\n\t\t) {\n\t\t\treturn true;\n\t\t}\n\n\t\tfor (const retirement of this.activeRetirements) {\n\t\t\tif (\n\t\t\t\tretirement.all ||\n\t\t\t\tretirement.host === host ||\n\t\t\t\tdescriptorIdentities.some(key => retirement.descriptors.has(key)) ||\n\t\t\t\t(actual != null && retirement.actuals.has(actual)) ||\n\t\t\t\t(actualAnyVariant != null && retirement.actuals.has(actualAnyVariant))\n\t\t\t) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n\n\tprivate retireConnection(descriptor: IntegrationAuthenticationSessionDescriptor): Retirement {\n\t\tconst host = domainKey(descriptor.domain);\n\t\tconst matching = [...this.observations.values()].filter(o => {\n\t\t\tif (domainKey(o.descriptorDomain) !== host && domainKey(o.actualDomain) !== host) return false;\n\t\t\tif (descriptor.cloud != null && o.cloud !== descriptor.cloud) return false;\n\t\t\treturn descriptor.connectionId == null\n\t\t\t\t? o.connectionId == null\n\t\t\t\t: o.connectionId === descriptor.connectionId || o.sessionId === descriptor.connectionId;\n\t\t});\n\t\tconst actuals = new Set(\n\t\t\tmatching\n\t\t\t\t.filter((o): o is Observation & { sessionId: string } => o.sessionId != null)\n\t\t\t\t.map(o => actualKey(o.actualDomain, o.sessionId, o.cloud)),\n\t\t);\n\t\tif (descriptor.connectionId != null) {\n\t\t\tactuals.add(actualKey(descriptor.domain, descriptor.connectionId, descriptor.cloud));\n\t\t}\n\n\t\tconst targets = [...this.observations.values()].filter(o => {\n\t\t\tif (descriptor.cloud != null && o.cloud !== descriptor.cloud) return false;\n\t\t\treturn (\n\t\t\t\tmatching.includes(o) ||\n\t\t\t\t(o.sessionId != null && actuals.has(actualKey(o.actualDomain, o.sessionId, o.cloud)))\n\t\t\t);\n\t\t});\n\t\tconst retirement: Retirement = { descriptors: new Set(), actuals: new Set() };\n\t\tretirement.descriptors.add(descriptorKey(descriptor.domain, descriptor.connectionId, descriptor.cloud));\n\t\tif (descriptor.connectionId != null) {\n\t\t\tretirement.actuals.add(actualKey(descriptor.domain, descriptor.connectionId, descriptor.cloud));\n\t\t}\n\n\t\tfor (const target of targets) {\n\t\t\tthis.addTarget(retirement, target);\n\t\t\tthis.publish(\n\t\t\t\t{\n\t\t\t\t\tpreviousSessionId: target.sessionId,\n\t\t\t\t\tconnectionId: target.connectionId,\n\t\t\t\t\tcloud: target.cloud,\n\t\t\t\t\treplacePrimary: target.connectionId == null,\n\t\t\t\t},\n\t\t\t\t[target.descriptorDomain, target.actualDomain],\n\t\t\t);\n\t\t}\n\n\t\tif (targets.every(target => target.connectionId !== descriptor.connectionId)) {\n\t\t\tthis.publish(\n\t\t\t\t{\n\t\t\t\t\tpreviousSessionId: descriptor.connectionId,\n\t\t\t\t\tconnectionId: descriptor.connectionId,\n\t\t\t\t\tcloud: descriptor.cloud,\n\t\t\t\t\treplacePrimary: descriptor.connectionId == null,\n\t\t\t\t},\n\t\t\t\t[descriptor.domain],\n\t\t\t);\n\t\t}\n\n\t\tthis.removeTargets(targets);\n\t\tthis.markRetirement(retirement);\n\t\treturn retirement;\n\t}\n\n\tprivate retireAll(domain?: string): Retirement {\n\t\tconst host = domain == null ? undefined : domainKey(domain);\n\t\tconst retirement: Retirement = { descriptors: new Set(), actuals: new Set(), host: host, all: host == null };\n\t\tconst targets = [...this.observations.values()].filter(\n\t\t\to => host == null || domainKey(o.descriptorDomain) === host || domainKey(o.actualDomain) === host,\n\t\t);\n\t\tfor (const target of targets) {\n\t\t\tthis.addTarget(retirement, target);\n\t\t\tthis.publish(\n\t\t\t\t{\n\t\t\t\t\tpreviousSessionId: target.sessionId,\n\t\t\t\t\tconnectionId: target.connectionId,\n\t\t\t\t\tcloud: target.cloud,\n\t\t\t\t\treplacePrimary: target.connectionId == null,\n\t\t\t\t},\n\t\t\t\t[target.descriptorDomain, target.actualDomain],\n\t\t\t);\n\t\t}\n\n\t\tif (targets.length === 0) {\n\t\t\tthis.publish({ replacePrimary: true }, [domain]);\n\t\t}\n\n\t\tthis.removeTargets(targets);\n\t\tthis.markRetirement(retirement);\n\t\treturn retirement;\n\t}\n\n\tprivate addTarget(retirement: Retirement, observation: Observation): void {\n\t\tretirement.descriptors.add(\n\t\t\tdescriptorKey(observation.descriptorDomain, observation.connectionId, observation.cloud),\n\t\t);\n\t\tif (observation.sessionId != null) {\n\t\t\tretirement.actuals.add(actualKey(observation.actualDomain, observation.sessionId, observation.cloud));\n\t\t}\n\t}\n\n\tprivate removeTargets(targets: Observation[]): void {\n\t\tconst removed = new Set(targets);\n\t\tfor (const [key, observation] of this.observations) {\n\t\t\tif (removed.has(observation)) {\n\t\t\t\tthis.observations.delete(key);\n\t\t\t}\n\t\t}\n\n\t\tfor (const [key, observation] of this.credentials) {\n\t\t\tif (removed.has(observation)) {\n\t\t\t\tthis.credentials.delete(key);\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate markRetirement(retirement: Retirement): void {\n\t\tconst mark = ++this.sequence;\n\t\tif (retirement.all) {\n\t\t\tthis.globalRetirement = mark;\n\t\t}\n\t\tif (retirement.host != null) {\n\t\t\tthis.hostRetirements.set(retirement.host, mark);\n\t\t}\n\t\tfor (const key of retirement.descriptors) {\n\t\t\tthis.descriptorRetirements.set(key, mark);\n\t\t}\n\n\t\tfor (const key of retirement.actuals) {\n\t\t\tthis.actualRetirements.set(key, mark);\n\t\t}\n\t}\n}\n"],"mappings":";;;;AA6BA,SAAS,UAAU,QAAwB;CAC1C,OAAO,eAAe,MAAM,KAAK;AAClC;AAEA,SAAS,cAAc,QAAgB,cAAkC,OAAoC;CAC5G,OAAO,KAAK,UAAU;EAAC,UAAU,MAAM;EAAG;EAAc;CAAK,CAAC;AAC/D;AAEA,SAAS,UAAU,QAAgB,IAAY,OAAoC;CAClF,OAAO,KAAK,UAAU;EAAC,UAAU,MAAM;EAAG;EAAI;CAAK,CAAC;AAC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UAAU;EAC9B,OAAO;CACR;CAEA,UAAkB,YAAwB,aAAgC;EACzE,WAAW,YAAY,IACtB,cAAc,YAAY,kBAAkB,YAAY,cAAc,YAAY,KAAK,CACxF;EACA,IAAI,YAAY,aAAa,MAC5B,WAAW,QAAQ,IAAI,UAAU,YAAY,cAAc,YAAY,WAAW,YAAY,KAAK,CAAC;CAEtG;CAEA,cAAsB,SAA8B;EACnD,MAAM,UAAU,IAAI,IAAI,OAAO;EAC/B,KAAK,MAAM,CAAC,KAAK,gBAAgB,KAAK,cACrC,IAAI,QAAQ,IAAI,WAAW,GAC1B,KAAK,aAAa,OAAO,GAAG;EAI9B,KAAK,MAAM,CAAC,KAAK,gBAAgB,KAAK,aACrC,IAAI,QAAQ,IAAI,WAAW,GAC1B,KAAK,YAAY,OAAO,GAAG;CAG9B;CAEA,eAAuB,YAA8B;EACpD,MAAM,OAAO,EAAE,KAAK;EACpB,IAAI,WAAW,KACd,KAAK,mBAAmB;EAEzB,IAAI,WAAW,QAAQ,MACtB,KAAK,gBAAgB,IAAI,WAAW,MAAM,IAAI;EAE/C,KAAK,MAAM,OAAO,WAAW,aAC5B,KAAK,sBAAsB,IAAI,KAAK,IAAI;EAGzC,KAAK,MAAM,OAAO,WAAW,SAC5B,KAAK,kBAAkB,IAAI,KAAK,IAAI;CAEtC;AACD"}
1
+ {"version":3,"file":"observedAuthenticationProvider.js","names":[],"sources":["../../../../../plus/integrations/src/authentication/observedAuthenticationProvider.ts"],"sourcesContent":["import { CancellationError } from '@gitlens/utils/cancellation.js';\nimport type { Event } from '@gitlens/utils/event.js';\nimport { areDomainsOnSameHost, hostFromDomain } from '../utils/domain.utils.js';\nimport type {\n\tGetSessionOptions,\n\tIntegrationAuthenticationProvider,\n\tIntegrationAuthenticationSessionDescriptor,\n} from './integrationAuthenticationProvider.js';\nimport type { ProviderAuthenticationSession, SessionPublication } from './models.js';\nimport { getSessionIdentity } from './models.js';\n\ntype Observation = {\n\trequest: number;\n\tidentity: string | undefined;\n\tdescriptorDomain: string;\n\tactualDomain: string;\n\tcloud: boolean | undefined;\n\tsessionKey?: string;\n\tsessionId?: string;\n\tconnectionId?: string;\n};\n\ntype Retirement = {\n\tdescriptors: Set<string>;\n\tactuals: Set<string>;\n\thost?: string;\n\tall?: boolean;\n};\n\nfunction domainKey(domain: string): string {\n\treturn hostFromDomain(domain) ?? domain;\n}\n\nfunction descriptorKey(domain: string, connectionId: string | undefined, cloud: boolean | undefined): string {\n\treturn JSON.stringify([domainKey(domain), connectionId, cloud]);\n}\n\nfunction actualKey(domain: string, id: string, cloud: boolean | undefined): string {\n\treturn JSON.stringify([domainKey(domain), id, cloud]);\n}\n\nexport class ObservedAuthenticationProvider implements IntegrationAuthenticationProvider {\n\tprivate readonly observations = new Map<string, Observation>();\n\tprivate readonly credentials = new Map<string, Observation>();\n\tprivate readonly descriptorRetirements = new Map<string, number>();\n\tprivate readonly actualRetirements = new Map<string, number>();\n\tprivate readonly hostRetirements = new Map<string, number>();\n\tprivate readonly activeRetirements = new Set<Retirement>();\n\tprivate sequence = 0;\n\tprivate globalRetirement = 0;\n\tprivate disposed = false;\n\n\tconstructor(\n\t\tprivate readonly host: IntegrationAuthenticationProvider,\n\t\tprivate readonly selfManaged: boolean,\n\t\tprivate readonly publish: (publication: SessionPublication, domains: (string | undefined)[]) => void,\n\t) {}\n\n\tget onDidChange(): Event<void> {\n\t\treturn this.host.onDidChange;\n\t}\n\n\tasync getSession(\n\t\tdescriptor: IntegrationAuthenticationSessionDescriptor,\n\t\toptions?: GetSessionOptions,\n\t): Promise<ProviderAuthenticationSession | undefined> {\n\t\tif (this.disposed) return undefined;\n\n\t\tconst request = ++this.sequence;\n\t\tconst scope = JSON.stringify([\n\t\t\tdescriptor.connectionId,\n\t\t\tdomainKey(descriptor.domain),\n\t\t\tdescriptor.cloud,\n\t\t\tdescriptor.scopes,\n\t\t]);\n\t\tconst source = await this.host.getSession(descriptor, options);\n\t\tif (source != null && this.selfManaged && !areDomainsOnSameHost(descriptor.domain, source.domain)) {\n\t\t\tthrow new CancellationError();\n\t\t}\n\t\tif (this.isRetired(request, descriptor, source)) throw new CancellationError();\n\n\t\tconst identity = getSessionIdentity(source);\n\t\tconst previous = this.observations.get(scope);\n\t\tconst sessionKey =\n\t\t\tsource == null\n\t\t\t\t? (previous?.sessionKey ??\n\t\t\t\t\t(descriptor.connectionId\n\t\t\t\t\t\t? actualKey(descriptor.domain, descriptor.connectionId, descriptor.cloud ?? true)\n\t\t\t\t\t\t: undefined))\n\t\t\t\t: actualKey(source.domain || descriptor.domain, source.id, source.cloud);\n\t\tconst credential = sessionKey == null ? undefined : this.credentials.get(sessionKey);\n\t\tconst latest =\n\t\t\tcredential != null && (previous == null || credential.request > previous.request) ? credential : previous;\n\t\tif (latest != null && latest.request > request && latest.identity !== identity) {\n\t\t\tthrow new CancellationError();\n\t\t}\n\n\t\tconst session: ProviderAuthenticationSession | undefined =\n\t\t\tsource == null\n\t\t\t\t? undefined\n\t\t\t\t: {\n\t\t\t\t\t\tid: source.id,\n\t\t\t\t\t\taccessToken: source.accessToken,\n\t\t\t\t\t\taccount: source.account,\n\t\t\t\t\t\tscopes: source.scopes,\n\t\t\t\t\t\tcloud: source.cloud,\n\t\t\t\t\t\ttype: source.type,\n\t\t\t\t\t\texpiresAt: source.expiresAt,\n\t\t\t\t\t\tdomain: source.domain,\n\t\t\t\t\t\tbaseUrl: source.baseUrl,\n\t\t\t\t\t\tprotocol: source.protocol,\n\t\t\t\t\t\tappKey: source.appKey,\n\t\t\t\t\t};\n\t\tif (latest == null || latest.request <= request) {\n\t\t\tif (previous == null || previous.identity !== identity || credential?.identity !== identity) {\n\t\t\t\tthis.publish(\n\t\t\t\t\t{\n\t\t\t\t\t\tsession: session,\n\t\t\t\t\t\tpreviousSessionId: latest?.sessionId ?? descriptor.connectionId,\n\t\t\t\t\t\tconnectionId: descriptor.connectionId,\n\t\t\t\t\t\tcloud: session != null ? session.cloud : (latest?.cloud ?? descriptor.cloud),\n\t\t\t\t\t\treplacePrimary: !descriptor.connectionId,\n\t\t\t\t\t},\n\t\t\t\t\t[descriptor.domain, session?.domain, previous?.actualDomain],\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tconst observation: Observation = {\n\t\t\t\trequest: request,\n\t\t\t\tidentity: identity,\n\t\t\t\tdescriptorDomain: descriptor.domain,\n\t\t\t\tactualDomain: session?.domain || descriptor.domain,\n\t\t\t\tcloud: session?.cloud ?? descriptor.cloud,\n\t\t\t\tsessionKey: sessionKey,\n\t\t\t\tsessionId: source?.id ?? latest?.sessionId ?? descriptor.connectionId,\n\t\t\t\tconnectionId: descriptor.connectionId,\n\t\t\t};\n\t\t\tthis.observations.set(scope, observation);\n\t\t\tif (sessionKey != null) {\n\t\t\t\tthis.credentials.set(sessionKey, observation);\n\t\t\t}\n\t\t}\n\n\t\treturn session;\n\t}\n\n\tasync deleteSession(\n\t\tdescriptor: IntegrationAuthenticationSessionDescriptor,\n\t\toptions?: { preserveConfigured?: boolean },\n\t): Promise<void> {\n\t\tconst retirement = this.retireConnection(descriptor);\n\t\tthis.activeRetirements.add(retirement);\n\t\ttry {\n\t\t\tawait this.host.deleteSession(descriptor, options);\n\t\t} finally {\n\t\t\tthis.markRetirement(retirement);\n\t\t\tthis.activeRetirements.delete(retirement);\n\t\t}\n\t}\n\n\tasync deleteAllSessions(descriptor?: IntegrationAuthenticationSessionDescriptor): Promise<void> {\n\t\tconst retirement = this.retireAll(this.selfManaged ? descriptor?.domain : undefined);\n\t\tthis.activeRetirements.add(retirement);\n\t\ttry {\n\t\t\tawait this.host.deleteAllSessions(descriptor);\n\t\t} finally {\n\t\t\tthis.markRetirement(retirement);\n\t\t\tthis.activeRetirements.delete(retirement);\n\t\t}\n\t}\n\n\tdispose(): void {\n\t\tif (this.disposed) return;\n\n\t\tthis.disposed = true;\n\t\tthis.retireAll();\n\t\tthis.host.dispose();\n\t}\n\n\tprivate isRetired(\n\t\trequest: number,\n\t\tdescriptor: IntegrationAuthenticationSessionDescriptor,\n\t\tsession: ProviderAuthenticationSession | undefined,\n\t): boolean {\n\t\tif (this.disposed || request < this.globalRetirement) return true;\n\n\t\tconst host = domainKey(descriptor.domain);\n\t\tconst variants = new Set([undefined, descriptor.cloud, session?.cloud]);\n\t\tif (descriptor.cloud == null && session?.cloud == null) {\n\t\t\tvariants.add(true);\n\t\t\tvariants.add(false);\n\t\t}\n\t\tconst descriptorIdentities = Array.from(variants, cloud =>\n\t\t\tdescriptorKey(descriptor.domain, descriptor.connectionId, cloud),\n\t\t);\n\t\tconst actual =\n\t\t\tsession == null ? undefined : actualKey(session.domain || descriptor.domain, session.id, session.cloud);\n\t\tconst actualAnyVariant =\n\t\t\tsession == null ? undefined : actualKey(session.domain || descriptor.domain, session.id, undefined);\n\t\tif (\n\t\t\trequest < (this.hostRetirements.get(host) ?? 0) ||\n\t\t\tdescriptorIdentities.some(key => request < (this.descriptorRetirements.get(key) ?? 0)) ||\n\t\t\t(actual != null && request < (this.actualRetirements.get(actual) ?? 0)) ||\n\t\t\t(actualAnyVariant != null && request < (this.actualRetirements.get(actualAnyVariant) ?? 0))\n\t\t) {\n\t\t\treturn true;\n\t\t}\n\n\t\tfor (const retirement of this.activeRetirements) {\n\t\t\tif (\n\t\t\t\tretirement.all ||\n\t\t\t\tretirement.host === host ||\n\t\t\t\tdescriptorIdentities.some(key => retirement.descriptors.has(key)) ||\n\t\t\t\t(actual != null && retirement.actuals.has(actual)) ||\n\t\t\t\t(actualAnyVariant != null && retirement.actuals.has(actualAnyVariant))\n\t\t\t) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n\n\tprivate retireConnection(descriptor: IntegrationAuthenticationSessionDescriptor): Retirement {\n\t\tconst host = domainKey(descriptor.domain);\n\t\tconst matching = [...this.observations.values()].filter(o => {\n\t\t\tif (domainKey(o.descriptorDomain) !== host && domainKey(o.actualDomain) !== host) return false;\n\t\t\tif (descriptor.cloud != null && o.cloud !== descriptor.cloud) return false;\n\t\t\treturn descriptor.connectionId == null\n\t\t\t\t? o.connectionId == null\n\t\t\t\t: o.connectionId === descriptor.connectionId || o.sessionId === descriptor.connectionId;\n\t\t});\n\t\tconst actuals = new Set(\n\t\t\tmatching\n\t\t\t\t.filter((o): o is Observation & { sessionId: string } => o.sessionId != null)\n\t\t\t\t.map(o => actualKey(o.actualDomain, o.sessionId, o.cloud)),\n\t\t);\n\t\tif (descriptor.connectionId != null) {\n\t\t\tactuals.add(actualKey(descriptor.domain, descriptor.connectionId, descriptor.cloud));\n\t\t}\n\n\t\tconst targets = [...this.observations.values()].filter(o => {\n\t\t\tif (descriptor.cloud != null && o.cloud !== descriptor.cloud) return false;\n\t\t\treturn (\n\t\t\t\tmatching.includes(o) ||\n\t\t\t\t(o.sessionId != null && actuals.has(actualKey(o.actualDomain, o.sessionId, o.cloud)))\n\t\t\t);\n\t\t});\n\t\tconst retirement: Retirement = { descriptors: new Set(), actuals: new Set() };\n\t\tretirement.descriptors.add(descriptorKey(descriptor.domain, descriptor.connectionId, descriptor.cloud));\n\t\tif (descriptor.connectionId != null) {\n\t\t\tretirement.actuals.add(actualKey(descriptor.domain, descriptor.connectionId, descriptor.cloud));\n\t\t}\n\n\t\tfor (const target of targets) {\n\t\t\tthis.addTarget(retirement, target);\n\t\t\tthis.publish(\n\t\t\t\t{\n\t\t\t\t\tpreviousSessionId: target.sessionId,\n\t\t\t\t\tconnectionId: target.connectionId,\n\t\t\t\t\tcloud: target.cloud,\n\t\t\t\t\treplacePrimary: target.connectionId == null,\n\t\t\t\t},\n\t\t\t\t[target.descriptorDomain, target.actualDomain],\n\t\t\t);\n\t\t}\n\n\t\tif (targets.every(target => target.connectionId !== descriptor.connectionId)) {\n\t\t\tthis.publish(\n\t\t\t\t{\n\t\t\t\t\tpreviousSessionId: descriptor.connectionId,\n\t\t\t\t\tconnectionId: descriptor.connectionId,\n\t\t\t\t\tcloud: descriptor.cloud,\n\t\t\t\t\treplacePrimary: descriptor.connectionId == null,\n\t\t\t\t},\n\t\t\t\t[descriptor.domain],\n\t\t\t);\n\t\t}\n\n\t\tthis.removeTargets(targets);\n\t\tthis.markRetirement(retirement);\n\t\treturn retirement;\n\t}\n\n\tprivate retireAll(domain?: string): Retirement {\n\t\tconst host = domain == null ? undefined : domainKey(domain);\n\t\tconst retirement: Retirement = { descriptors: new Set(), actuals: new Set(), host: host, all: host == null };\n\t\tconst targets = [...this.observations.values()].filter(\n\t\t\to => host == null || domainKey(o.descriptorDomain) === host || domainKey(o.actualDomain) === host,\n\t\t);\n\t\tfor (const target of targets) {\n\t\t\tthis.addTarget(retirement, target);\n\t\t\tthis.publish(\n\t\t\t\t{\n\t\t\t\t\tpreviousSessionId: target.sessionId,\n\t\t\t\t\tconnectionId: target.connectionId,\n\t\t\t\t\tcloud: target.cloud,\n\t\t\t\t\treplacePrimary: target.connectionId == null,\n\t\t\t\t},\n\t\t\t\t[target.descriptorDomain, target.actualDomain],\n\t\t\t);\n\t\t}\n\n\t\tthis.publish({ replacePrimary: true, retireAll: true }, [domain]);\n\n\t\tthis.removeTargets(targets);\n\t\tthis.markRetirement(retirement);\n\t\treturn retirement;\n\t}\n\n\tprivate addTarget(retirement: Retirement, observation: Observation): void {\n\t\tretirement.descriptors.add(\n\t\t\tdescriptorKey(observation.descriptorDomain, observation.connectionId, observation.cloud),\n\t\t);\n\t\tif (observation.sessionId != null) {\n\t\t\tretirement.actuals.add(actualKey(observation.actualDomain, observation.sessionId, observation.cloud));\n\t\t}\n\t}\n\n\tprivate removeTargets(targets: Observation[]): void {\n\t\tconst removed = new Set(targets);\n\t\tfor (const [key, observation] of this.observations) {\n\t\t\tif (removed.has(observation)) {\n\t\t\t\tthis.observations.delete(key);\n\t\t\t}\n\t\t}\n\n\t\tfor (const [key, observation] of this.credentials) {\n\t\t\tif (removed.has(observation)) {\n\t\t\t\tthis.credentials.delete(key);\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate markRetirement(retirement: Retirement): void {\n\t\tconst mark = ++this.sequence;\n\t\tif (retirement.all) {\n\t\t\tthis.globalRetirement = mark;\n\t\t}\n\t\tif (retirement.host != null) {\n\t\t\tthis.hostRetirements.set(retirement.host, mark);\n\t\t}\n\t\tfor (const key of retirement.descriptors) {\n\t\t\tthis.descriptorRetirements.set(key, mark);\n\t\t}\n\n\t\tfor (const key of retirement.actuals) {\n\t\t\tthis.actualRetirements.set(key, mark);\n\t\t}\n\t}\n}\n"],"mappings":";;;;AA6BA,SAAS,UAAU,QAAwB;CAC1C,OAAO,eAAe,MAAM,KAAK;AAClC;AAEA,SAAS,cAAc,QAAgB,cAAkC,OAAoC;CAC5G,OAAO,KAAK,UAAU;EAAC,UAAU,MAAM;EAAG;EAAc;CAAK,CAAC;AAC/D;AAEA,SAAS,UAAU,QAAgB,IAAY,OAAoC;CAClF,OAAO,KAAK,UAAU;EAAC,UAAU,MAAM;EAAG;EAAI;CAAK,CAAC;AACrD;AAEA,IAAa,iCAAb,MAAyF;CAYtE;CACA;CACA;CAblB,+BAAgC,IAAI,IAAyB;CAC7D,8BAA+B,IAAI,IAAyB;CAC5D,wCAAyC,IAAI,IAAoB;CACjE,oCAAqC,IAAI,IAAoB;CAC7D,kCAAmC,IAAI,IAAoB;CAC3D,oCAAqC,IAAI,IAAgB;CACzD,WAAmB;CACnB,mBAA2B;CAC3B,WAAmB;CAEnB,YACC,MACA,aACA,SACC;EAHgB,KAAA,OAAA;EACA,KAAA,cAAA;EACA,KAAA,UAAA;CACf;CAEH,IAAI,cAA2B;EAC9B,OAAO,KAAK,KAAK;CAClB;CAEA,MAAM,WACL,YACA,SACqD;EACrD,IAAI,KAAK,UAAU,OAAO,KAAA;EAE1B,MAAM,UAAU,EAAE,KAAK;EACvB,MAAM,QAAQ,KAAK,UAAU;GAC5B,WAAW;GACX,UAAU,WAAW,MAAM;GAC3B,WAAW;GACX,WAAW;EACZ,CAAC;EACD,MAAM,SAAS,MAAM,KAAK,KAAK,WAAW,YAAY,OAAO;EAC7D,IAAI,UAAU,QAAQ,KAAK,e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O,WAAW,aAC5B,KAAK,sBAAsB,IAAI,KAAK,IAAI;EAGzC,KAAK,MAAM,OAAO,WAAW,SAC5B,KAAK,kBAAkB,IAAI,KAAK,IAAI;CAEtC;AACD"}
@@ -9,7 +9,7 @@ import __decorate from "../../_virtual/@oxc-project+runtime/helpers/esm/decorate
9
9
  import { gate } from "../../utils/decorators/gate.js";
10
10
  import { toError } from "./errors.js";
11
11
  import { GitCloudHostIntegrationId, GitSelfManagedHostIntegrationId, IssuesCloudHostIntegrationId, IssuesSelfManagedHostIntegrationId } from "./constants.js";
12
- import { getRemoteHostMatcher, hostFromDomain, sameConfiguredBaseUrl } from "./utils/domain.utils.js";
12
+ import { areDomainsOnSameHost, getRemoteHostMatcher, hostFromDomain, sameConfiguredBaseUrl } from "./utils/domain.utils.js";
13
13
  import { providersMetadata } from "./providers/models.js";
14
14
  import { convertRemoteProviderIdToIntegrationId, getIntegrationIdForRemote, isCloudSelfManagedHostIntegrationId, isGitCloudHostIntegrationId, isGitSelfManagedHostIntegrationId, isNonExpiringZeroTokenIntegrationId, isSelfManagedHostIntegrationId, remoteProviderTypeForConfig, remoteProviderTypeForIntegration } from "./utils/integration.utils.js";
15
15
  import { getSupportedCloudIntegrationIds, isSupportedCloudIntegrationId, toIntegrationId } from "./authentication/models.js";
@@ -69,6 +69,12 @@ var IntegrationService = class {
69
69
  this.ctx = ctx;
70
70
  this._disposable = fromDisposables(configuredIntegrationService.onWillChangeSession(({ integrationId, session, previousDomain }) => {
71
71
  this.onSessionPublishing(integrationId, { session }, [session.domain, previousDomain]);
72
+ }), configuredIntegrationService.onWillRemoveSessions(({ integrationId, connectionId, cloud, domain }) => {
73
+ for (const integration of this._integrations.values()) {
74
+ if (integration.id !== integrationId) continue;
75
+ if (domain != null && isSelfManagedHostIntegrationId(integrationId) && !areDomainsOnSameHost(integration.domain, domain)) continue;
76
+ integration.onSessionsRemoving(connectionId, cloud);
77
+ }
72
78
  }), ctx.config.onDidChange((e) => {
73
79
  if (e.remotes) this._ignoreSSLErrors.clear();
74
80
  }), ctx.account.onDidChangeSessions(this.onAuthenticationSessionsChanged, this), ctx.account.onDidCheckIn(this.onUserCheckedIn, this), ctx.account.onDidChange(this.onSubscriptionChanged, this), this._onDidChangeIntegrationConnection.event(this.onIntegrationConnectionChanged, this));