@gitkraken/core-gitlens 0.10.1 → 0.10.3

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 (37) hide show
  1. package/CHANGELOG.md +17 -1
  2. package/dist/plus/integrations/authentication/configuredIntegrationService.d.ts +40 -27
  3. package/dist/plus/integrations/authentication/configuredIntegrationService.js +92 -22
  4. package/dist/plus/integrations/authentication/configuredIntegrationService.js.map +1 -1
  5. package/dist/plus/integrations/authentication/integrationAuthenticationProvider.js +10 -6
  6. package/dist/plus/integrations/authentication/integrationAuthenticationProvider.js.map +1 -1
  7. package/dist/plus/integrations/collectionMetadata.d.ts +1 -1
  8. package/dist/plus/integrations/collectionMetadata.js +19 -8
  9. package/dist/plus/integrations/collectionMetadata.js.map +1 -1
  10. package/dist/plus/integrations/errors.d.ts +2 -0
  11. package/dist/plus/integrations/errors.js +45 -1
  12. package/dist/plus/integrations/errors.js.map +1 -1
  13. package/dist/plus/integrations/integrationService.js +2 -1
  14. package/dist/plus/integrations/integrationService.js.map +1 -1
  15. package/dist/plus/integrations/models/gitHostIntegration.js +18 -16
  16. package/dist/plus/integrations/models/gitHostIntegration.js.map +1 -1
  17. package/dist/plus/integrations/models/integration.d.ts +46 -8
  18. package/dist/plus/integrations/models/integration.js +159 -54
  19. package/dist/plus/integrations/models/integration.js.map +1 -1
  20. package/dist/plus/integrations/providers/azure/azure.js +2 -6
  21. package/dist/plus/integrations/providers/azure/azure.js.map +1 -1
  22. package/dist/plus/integrations/providers/azureDevOps.d.ts +1 -2
  23. package/dist/plus/integrations/providers/azureDevOps.js +12 -5
  24. package/dist/plus/integrations/providers/azureDevOps.js.map +1 -1
  25. package/dist/plus/integrations/providers/azureDevOpsServer.js.map +1 -1
  26. package/dist/plus/integrations/providers/github.js +1 -4
  27. package/dist/plus/integrations/providers/github.js.map +1 -1
  28. package/dist/plus/integrations/providers/issueSorts.d.ts +0 -1
  29. package/dist/plus/integrations/providers/jira.js +1 -0
  30. package/dist/plus/integrations/providers/jira.js.map +1 -1
  31. package/dist/plus/integrations/providers/linear.js +1 -0
  32. package/dist/plus/integrations/providers/linear.js.map +1 -1
  33. package/dist/plus/integrations/reads/drains.d.ts +0 -1
  34. package/dist/plus/integrations/results.d.ts +8 -5
  35. package/dist/plus/integrations/results.js +3 -1
  36. package/dist/plus/integrations/results.js.map +1 -1
  37. package/package.json +1 -1
@@ -76,8 +76,7 @@ var GitHostIntegration = class extends IntegrationBase {
76
76
  }
77
77
  async getAccountForEmail(repo, email, options) {
78
78
  const scope = getScopedLogger();
79
- if (!(this.maybeConnected ?? await this.isConnected())) return void 0;
80
- await this.refreshSessionIfExpired(scope);
79
+ if (await this.prepareSessionLookup() != null) return void 0;
81
80
  try {
82
81
  const author = await this.getProviderAccountForEmail(this._session, repo, email, options);
83
82
  this.resetRequestExceptionCount("getAccountForEmail");
@@ -94,8 +93,7 @@ var GitHostIntegration = class extends IntegrationBase {
94
93
  */
95
94
  async getSshSigningKeysForEmails(repo, emails) {
96
95
  const scope = getScopedLogger();
97
- if (!(this.maybeConnected ?? await this.isConnected())) return /* @__PURE__ */ new Map();
98
- await this.refreshSessionIfExpired(scope);
96
+ if (await this.prepareSessionLookup() != null) return /* @__PURE__ */ new Map();
99
97
  try {
100
98
  const keys = await this.getProviderSshSigningKeysForEmails(this._session, repo, emails);
101
99
  this.resetRequestExceptionCount("getSshSigningKeysForEmails");
@@ -111,8 +109,7 @@ var GitHostIntegration = class extends IntegrationBase {
111
109
  }
112
110
  async getAccountForCommit(repo, rev, options) {
113
111
  const scope = getScopedLogger();
114
- if (!(this.maybeConnected ?? await this.isConnected())) return void 0;
115
- await this.refreshSessionIfExpired(scope);
112
+ if (await this.prepareSessionLookup() != null) return void 0;
116
113
  try {
117
114
  const author = await this.getProviderAccountForCommit(this._session, repo, rev, options);
118
115
  this.resetRequestExceptionCount("getAccountForCommit");
@@ -124,8 +121,7 @@ var GitHostIntegration = class extends IntegrationBase {
124
121
  }
125
122
  async getDefaultBranch(repo, options) {
126
123
  const scope = getScopedLogger();
127
- if (!(this.maybeConnected ?? await this.isConnected())) return void 0;
128
- await this.refreshSessionIfExpired(scope);
124
+ if (await this.prepareSessionLookup() != null) return void 0;
129
125
  return this.ctx.cache.getRepositoryDefaultBranch(repo, this, () => ({ value: (async () => {
130
126
  try {
131
127
  const result = await this.getProviderDefaultBranch(this._session, repo, options?.cancellation);
@@ -158,8 +154,7 @@ var GitHostIntegration = class extends IntegrationBase {
158
154
  }
159
155
  async getRepositoryMetadata(repo, options) {
160
156
  const scope = getScopedLogger();
161
- if (!(this.maybeConnected ?? await this.isConnected())) return void 0;
162
- await this.refreshSessionIfExpired(scope);
157
+ if (await this.prepareSessionLookup() != null) return void 0;
163
158
  return this.ctx.cache.getRepositoryMetadata(repo, this, () => ({ value: (async () => {
164
159
  try {
165
160
  const result = await this.getProviderRepositoryMetadata(this._session, repo, options?.cancellation);
@@ -362,8 +357,7 @@ var GitHostIntegration = class extends IntegrationBase {
362
357
  }
363
358
  async mergePullRequest(pr, options, cancellation) {
364
359
  const scope = getScopedLogger();
365
- if (!(this.maybeConnected ?? await this.isConnected())) return false;
366
- await this.refreshSessionIfExpired(scope);
360
+ if (await this.prepareSessionLookup() != null) return false;
367
361
  try {
368
362
  const result = await this.mergeProviderPullRequest(this._session, pr, options, cancellation);
369
363
  this.resetRequestExceptionCount("mergePullRequest");
@@ -378,9 +372,13 @@ var GitHostIntegration = class extends IntegrationBase {
378
372
  }
379
373
  async getPullRequestForBranch(repo, branch, options) {
380
374
  const scope = getScopedLogger();
381
- if (!(this.maybeConnected ?? await this.isConnected())) return void 0;
382
- await this.refreshSessionIfExpired(scope);
375
+ const refreshFailure = await this.prepareSessionLookup();
376
+ if (refreshFailure === "unconnected") return void 0;
383
377
  const { expiryOverride, throwOnError, ...opts } = options ?? {};
378
+ if (refreshFailure != null) {
379
+ if (throwOnError) throw refreshFailure;
380
+ return;
381
+ }
384
382
  return this.ctx.cache.getPullRequestForBranch(branch, repo, this, (cacheable) => ({ value: (async () => {
385
383
  try {
386
384
  const result = await this.getProviderPullRequestForBranch(this._session, repo, branch, opts);
@@ -396,9 +394,13 @@ var GitHostIntegration = class extends IntegrationBase {
396
394
  }
397
395
  async getPullRequestForCommit(repo, rev, options) {
398
396
  const scope = getScopedLogger();
399
- if (!(this.maybeConnected ?? await this.isConnected())) return void 0;
400
- await this.refreshSessionIfExpired(scope);
397
+ const refreshFailure = await this.prepareSessionLookup();
398
+ if (refreshFailure === "unconnected") return void 0;
401
399
  const { throwOnError, ...cacheOptions } = options ?? {};
400
+ if (refreshFailure != null) {
401
+ if (throwOnError) throw refreshFailure;
402
+ return;
403
+ }
402
404
  return this.ctx.cache.getPullRequestForSha(rev, repo, this, (cacheable) => ({ value: (async () => {
403
405
  try {
404
406
  const result = await this.getProviderPullRequestForCommit(this._session, repo, rev);