@gitkraken/core-gitlens 0.9.9 → 0.10.1

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 (53) hide show
  1. package/CHANGELOG.md +27 -1
  2. package/dist/git/errors.d.ts +7 -0
  3. package/dist/git/errors.js +14 -1
  4. package/dist/git/errors.js.map +1 -1
  5. package/dist/git/providers/status.d.ts +6 -1
  6. package/dist/git/run.types.d.ts +9 -4
  7. package/dist/git-cli/exec/git.js +36 -16
  8. package/dist/git-cli/exec/git.js.map +1 -1
  9. package/dist/git-cli/providers/diff.d.ts +5 -2
  10. package/dist/git-cli/providers/diff.js +21 -9
  11. package/dist/git-cli/providers/diff.js.map +1 -1
  12. package/dist/git-cli/providers/patch.js +5 -7
  13. package/dist/git-cli/providers/patch.js.map +1 -1
  14. package/dist/git-cli/providers/status.d.ts +0 -1
  15. package/dist/git-cli/providers/status.js +119 -142
  16. package/dist/git-cli/providers/status.js.map +1 -1
  17. package/dist/plus/git-github/providers/github/status.d.ts +0 -1
  18. package/dist/plus/git-github/providers/github/status.js.map +1 -1
  19. package/dist/plus/integrations/authentication/cloudIntegrationService.js +24 -7
  20. package/dist/plus/integrations/authentication/cloudIntegrationService.js.map +1 -1
  21. package/dist/plus/integrations/authentication/integrationAuthenticationProvider.d.ts +7 -0
  22. package/dist/plus/integrations/authentication/integrationAuthenticationProvider.js +13 -3
  23. package/dist/plus/integrations/authentication/integrationAuthenticationProvider.js.map +1 -1
  24. package/dist/plus/integrations/integrationService.js +4 -2
  25. package/dist/plus/integrations/integrationService.js.map +1 -1
  26. package/dist/plus/integrations/models/gitHostIntegration.js +20 -20
  27. package/dist/plus/integrations/models/gitHostIntegration.js.map +1 -1
  28. package/dist/plus/integrations/models/integration.d.ts +29 -3
  29. package/dist/plus/integrations/models/integration.js +53 -12
  30. package/dist/plus/integrations/models/integration.js.map +1 -1
  31. package/dist/plus/integrations/models/issuesIntegration.js +9 -9
  32. package/dist/plus/integrations/models/issuesIntegration.js.map +1 -1
  33. package/dist/plus/integrations/providers/azureDevOps.js +1 -1
  34. package/dist/plus/integrations/providers/azureDevOps.js.map +1 -1
  35. package/dist/plus/integrations/providers/azureDevOpsServer.js +1 -1
  36. package/dist/plus/integrations/providers/azureDevOpsServer.js.map +1 -1
  37. package/dist/plus/integrations/providers/bitbucket-server.js +1 -1
  38. package/dist/plus/integrations/providers/bitbucket-server.js.map +1 -1
  39. package/dist/plus/integrations/providers/bitbucket.js +1 -1
  40. package/dist/plus/integrations/providers/bitbucket.js.map +1 -1
  41. package/dist/plus/integrations/providers/github.js +2 -2
  42. package/dist/plus/integrations/providers/github.js.map +1 -1
  43. package/dist/plus/integrations/providers/gitlab.js +1 -1
  44. package/dist/plus/integrations/providers/gitlab.js.map +1 -1
  45. package/dist/plus/integrations/providers/issueSorts.d.ts +1 -0
  46. package/dist/plus/integrations/reads/drains.d.ts +1 -0
  47. package/dist/utils/cancellation.d.ts +4 -1
  48. package/dist/utils/cancellation.js +4 -2
  49. package/dist/utils/cancellation.js.map +1 -1
  50. package/dist/utils/env/node/exec.d.ts +5 -1
  51. package/dist/utils/env/node/exec.js +8 -5
  52. package/dist/utils/env/node/exec.js.map +1 -1
  53. package/package.json +1 -1
@@ -17,7 +17,7 @@ import { mergeCollectionMetadata, throwIfAllSettledFailed } from "../providers/u
17
17
  import { areDomainsOnSameHost } from "../utils/domain.utils.js";
18
18
  import { getSelfManagedBaseUrl, isGitSelfManagedHostIntegrationId } from "../utils/integration.utils.js";
19
19
  import { toIssueShape, toProviderIssueStates, toProviderPullRequestStates } from "../providers/models.js";
20
- import { IntegrationBase } from "./integration.js";
20
+ import { IntegrationBase, isReadSessionFailure } from "./integration.js";
21
21
  //#region ../plus/integrations/src/models/gitHostIntegration.ts
22
22
  /**
23
23
  * Whether an SDK read for `providerId` must send the session's secret as an HTTP Basic credential.
@@ -144,7 +144,7 @@ var GitHostIntegration = class extends IntegrationBase {
144
144
  * its own error, which the caller reports for the connection instead of the repository's refusal.
145
145
  */
146
146
  async settleRepositoryRefusal(repo, refusal) {
147
- const session = await this.resolveReadSession(repo.connectionId, void 0);
147
+ const session = await this.resolveReadSessionOrThrow(repo.connectionId, void 0);
148
148
  if (session == null) return void 0;
149
149
  const [slot] = await this.settleBatchRefusals(session, [{
150
150
  owner: repo.owner,
@@ -235,7 +235,7 @@ var GitHostIntegration = class extends IntegrationBase {
235
235
  async getOrganizationsForUserResult(connectionId) {
236
236
  const scope = getScopedLogger();
237
237
  const session = await this.resolveReadSession(connectionId, scope);
238
- if (session == null) return void 0;
238
+ if (session == null || isReadSessionFailure(session)) return session && { error: session.error };
239
239
  const start = performance.now();
240
240
  try {
241
241
  const result = await this.getProviderOrganizationsForUser?.(session);
@@ -271,7 +271,7 @@ var GitHostIntegration = class extends IntegrationBase {
271
271
  async getProjectsForOrgResult(org, connectionId) {
272
272
  const scope = getScopedLogger();
273
273
  const session = await this.resolveReadSession(connectionId, scope);
274
- if (session == null) return void 0;
274
+ if (session == null || isReadSessionFailure(session)) return session && { error: session.error };
275
275
  if (this.getProviderProjectsForOrg == null) return;
276
276
  const start = performance.now();
277
277
  try {
@@ -307,7 +307,7 @@ var GitHostIntegration = class extends IntegrationBase {
307
307
  async getRepositoriesForOrgResult(org, options) {
308
308
  const scope = getScopedLogger();
309
309
  const session = await this.resolveReadSession(options?.connectionId, scope);
310
- if (session == null) return void 0;
310
+ if (session == null || isReadSessionFailure(session)) return session && { error: session.error };
311
311
  const start = performance.now();
312
312
  try {
313
313
  const result = await this.getProviderRepositoriesForOrg?.(session, org, options);
@@ -338,7 +338,7 @@ var GitHostIntegration = class extends IntegrationBase {
338
338
  async getRepositoriesForUserResult(options) {
339
339
  const scope = getScopedLogger();
340
340
  const session = await this.resolveReadSession(options?.connectionId, scope);
341
- if (session == null) return void 0;
341
+ if (session == null || isReadSessionFailure(session)) return session && { error: session.error };
342
342
  if (this.getProviderRepositoriesForUser == null) return;
343
343
  const start = performance.now();
344
344
  try {
@@ -467,7 +467,7 @@ var GitHostIntegration = class extends IntegrationBase {
467
467
  const providerId = this.authProvider.id;
468
468
  const states = toProviderIssueStates(options?.state);
469
469
  const session = await this.resolveReadSession(connectionId, scope);
470
- if (session == null) return void 0;
470
+ if (session == null || isReadSessionFailure(session)) return session && { error: session.error };
471
471
  const start = performance.now();
472
472
  let customUrl;
473
473
  let api;
@@ -795,7 +795,7 @@ var GitHostIntegration = class extends IntegrationBase {
795
795
  const providerId = this.authProvider.id;
796
796
  const states = toProviderPullRequestStates(options?.state);
797
797
  const session = await this.resolveReadSession(connectionId, scope);
798
- if (session == null) return void 0;
798
+ if (session == null || isReadSessionFailure(session)) return session && { error: session.error };
799
799
  const start = performance.now();
800
800
  let customUrl;
801
801
  let api;
@@ -1002,7 +1002,7 @@ var GitHostIntegration = class extends IntegrationBase {
1002
1002
  const scope = getScopedLogger();
1003
1003
  const { connectionId, ...searchOptions } = options ?? {};
1004
1004
  const session = await this.resolveReadSession(connectionId, scope);
1005
- if (session == null) return void 0;
1005
+ if (session == null || isReadSessionFailure(session)) return session && { error: session.error };
1006
1006
  const start = performance.now();
1007
1007
  try {
1008
1008
  const prs = await this.searchProviderMyPullRequests(session, ensureArray(repos), cancellation, searchOptions);
@@ -1034,7 +1034,7 @@ var GitHostIntegration = class extends IntegrationBase {
1034
1034
  async getMyPullRequestsForUserResult(options, connectionId) {
1035
1035
  const scope = getScopedLogger();
1036
1036
  const session = await this.resolveReadSession(connectionId, scope);
1037
- if (session == null) return void 0;
1037
+ if (session == null || isReadSessionFailure(session)) return session && { error: session.error };
1038
1038
  if (this.getProviderMyPullRequestsForUser == null) return;
1039
1039
  const start = performance.now();
1040
1040
  try {
@@ -1092,7 +1092,7 @@ var GitHostIntegration = class extends IntegrationBase {
1092
1092
  async searchPullRequestsPageResult(options, cancellation, connectionId) {
1093
1093
  const scope = getScopedLogger();
1094
1094
  const session = await this.resolveReadSession(connectionId, scope);
1095
- if (session == null) return void 0;
1095
+ if (session == null || isReadSessionFailure(session)) return session && { error: session.error };
1096
1096
  const start = performance.now();
1097
1097
  try {
1098
1098
  const result = await this.searchProviderPullRequestsPage?.(session, options, cancellation);
@@ -1118,7 +1118,7 @@ var GitHostIntegration = class extends IntegrationBase {
1118
1118
  const scope = getScopedLogger();
1119
1119
  const { connectionId, ...searchOptions } = options ?? {};
1120
1120
  const session = await this.resolveReadSession(connectionId, scope);
1121
- if (session == null) return void 0;
1121
+ if (session == null || isReadSessionFailure(session)) return void 0;
1122
1122
  try {
1123
1123
  const prs = await this.searchProviderPullRequests?.(session, searchQuery, ensureArray(repos), cancellation, searchOptions);
1124
1124
  this.resetRequestExceptionCount("searchPullRequests");
@@ -1144,7 +1144,7 @@ var GitHostIntegration = class extends IntegrationBase {
1144
1144
  async searchIssuesPageResult(options, cancellation, connectionId) {
1145
1145
  const scope = getScopedLogger();
1146
1146
  const session = await this.resolveReadSession(connectionId, scope);
1147
- if (session == null) return void 0;
1147
+ if (session == null || isReadSessionFailure(session)) return session && { error: session.error };
1148
1148
  const start = performance.now();
1149
1149
  try {
1150
1150
  const result = await this.searchProviderIssuesPage?.(session, options, cancellation);
@@ -1175,7 +1175,7 @@ var GitHostIntegration = class extends IntegrationBase {
1175
1175
  async countIssuesResult(scopes, cancellation, connectionId) {
1176
1176
  const scope = getScopedLogger();
1177
1177
  const session = await this.resolveReadSession(connectionId, scope);
1178
- if (session == null) return void 0;
1178
+ if (session == null || isReadSessionFailure(session)) return session && { error: session.error };
1179
1179
  const start = performance.now();
1180
1180
  try {
1181
1181
  const counts = await this.countProviderIssues?.(session, scopes, cancellation);
@@ -1222,7 +1222,7 @@ var GitHostIntegration = class extends IntegrationBase {
1222
1222
  async getIssuesBatchResult(coordinates, cancellation, connectionId) {
1223
1223
  const scope = getScopedLogger();
1224
1224
  const session = await this.resolveReadSession(connectionId, scope);
1225
- if (session == null) return void 0;
1225
+ if (session == null || isReadSessionFailure(session)) return session && { error: session.error };
1226
1226
  const start = performance.now();
1227
1227
  let slots;
1228
1228
  try {
@@ -1273,7 +1273,7 @@ var GitHostIntegration = class extends IntegrationBase {
1273
1273
  async getPullRequestsBatchResult(coordinates, options, cancellation, connectionId) {
1274
1274
  const scope = getScopedLogger();
1275
1275
  const session = await this.resolveReadSession(connectionId, scope);
1276
- if (session == null) return void 0;
1276
+ if (session == null || isReadSessionFailure(session)) return session && { error: session.error };
1277
1277
  const start = performance.now();
1278
1278
  let slots;
1279
1279
  try {
@@ -1321,7 +1321,7 @@ var GitHostIntegration = class extends IntegrationBase {
1321
1321
  async getIssuesEtagFieldsResult(coordinates, options, cancellation, connectionId) {
1322
1322
  const scope = getScopedLogger();
1323
1323
  const session = await this.resolveReadSession(connectionId, scope);
1324
- if (session == null) return void 0;
1324
+ if (session == null || isReadSessionFailure(session)) return session && { error: session.error };
1325
1325
  const start = performance.now();
1326
1326
  try {
1327
1327
  const slots = await this.getProviderIssuesEtagFields?.(session, coordinates, options, cancellation);
@@ -1357,7 +1357,7 @@ var GitHostIntegration = class extends IntegrationBase {
1357
1357
  async getPullRequestsEtagFieldsResult(coordinates, options, cancellation, connectionId) {
1358
1358
  const scope = getScopedLogger();
1359
1359
  const session = await this.resolveReadSession(connectionId, scope);
1360
- if (session == null) return void 0;
1360
+ if (session == null || isReadSessionFailure(session)) return session && { error: session.error };
1361
1361
  const start = performance.now();
1362
1362
  try {
1363
1363
  const slots = await this.getProviderPullRequestsEtagFields?.(session, coordinates, options, cancellation);
@@ -1400,7 +1400,7 @@ var GitHostIntegration = class extends IntegrationBase {
1400
1400
  async getPullRequestsForBranchesResult(targets, options, cancellation, connectionId) {
1401
1401
  const scope = getScopedLogger();
1402
1402
  const session = await this.resolveReadSession(connectionId, scope);
1403
- if (session == null) return void 0;
1403
+ if (session == null || isReadSessionFailure(session)) return session && { error: session.error };
1404
1404
  const start = performance.now();
1405
1405
  let slots;
1406
1406
  try {
@@ -1440,7 +1440,7 @@ var GitHostIntegration = class extends IntegrationBase {
1440
1440
  async countPullRequestsResult(scopes, cancellation, connectionId) {
1441
1441
  const scope = getScopedLogger();
1442
1442
  const session = await this.resolveReadSession(connectionId, scope);
1443
- if (session == null) return void 0;
1443
+ if (session == null || isReadSessionFailure(session)) return session && { error: session.error };
1444
1444
  const start = performance.now();
1445
1445
  try {
1446
1446
  const counts = await this.countProviderPullRequests?.(session, scopes, cancellation);