@gitkraken/core-gitlens 0.51.1 → 0.53.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 (71) hide show
  1. package/CHANGELOG.md +15 -1
  2. package/dist/_types/provider-apis/types/exportedTypes/github.d.ts +75 -0
  3. package/dist/_types/provider-apis/types/exportedTypes/types.d.ts +7 -0
  4. package/dist/git-cli/providers/config.js +2 -2
  5. package/dist/git-cli/providers/pausedOperations.js +2 -2
  6. package/dist/git-cli/providers/pausedOperations.js.map +1 -1
  7. package/dist/git-cli/providers/staging.js +1 -1
  8. package/dist/ipc/discovery.js +1 -1
  9. package/dist/plus/agents/providers/claudeCodeTranscript.js +6 -6
  10. package/dist/plus/agents/providers/claudeCodeTranscript.js.map +1 -1
  11. package/dist/plus/ai/providers/openAICompatibleProviderBase.js +1 -1
  12. package/dist/plus/git-github/api/issueWrites.js +1 -1
  13. package/dist/plus/git-github/api/issueWrites.js.map +1 -1
  14. package/dist/plus/integrations/authentication/cloudIntegrationAuthenticationProvider.d.ts +10 -1
  15. package/dist/plus/integrations/authentication/cloudIntegrationAuthenticationProvider.js +75 -23
  16. package/dist/plus/integrations/authentication/cloudIntegrationAuthenticationProvider.js.map +1 -1
  17. package/dist/plus/integrations/authentication/cloudIntegrationObservations.d.ts +49 -0
  18. package/dist/plus/integrations/authentication/cloudIntegrationObservations.js +118 -0
  19. package/dist/plus/integrations/authentication/cloudIntegrationObservations.js.map +1 -0
  20. package/dist/plus/integrations/authentication/configuredIntegrationService.d.ts +45 -25
  21. package/dist/plus/integrations/authentication/configuredIntegrationService.js +409 -141
  22. package/dist/plus/integrations/authentication/configuredIntegrationService.js.map +1 -1
  23. package/dist/plus/integrations/authentication/integrationAuthenticationService.d.ts +12 -3
  24. package/dist/plus/integrations/authentication/integrationAuthenticationService.js +39 -7
  25. package/dist/plus/integrations/authentication/integrationAuthenticationService.js.map +1 -1
  26. package/dist/plus/integrations/authentication/models.d.ts +6 -0
  27. package/dist/plus/integrations/authentication/models.js +9 -1
  28. package/dist/plus/integrations/authentication/models.js.map +1 -1
  29. package/dist/plus/integrations/authentication/observedAuthenticationProvider.d.ts +17 -2
  30. package/dist/plus/integrations/authentication/observedAuthenticationProvider.js +84 -16
  31. package/dist/plus/integrations/authentication/observedAuthenticationProvider.js.map +1 -1
  32. package/dist/plus/integrations/index.d.ts +3 -2
  33. package/dist/plus/integrations/index.js.map +1 -1
  34. package/dist/plus/integrations/integrationService.d.ts +9 -0
  35. package/dist/plus/integrations/integrationService.js +182 -39
  36. package/dist/plus/integrations/integrationService.js.map +1 -1
  37. package/dist/plus/integrations/manager.d.ts +3 -0
  38. package/dist/plus/integrations/models/integration.d.ts +4 -0
  39. package/dist/plus/integrations/models/integration.js +61 -16
  40. package/dist/plus/integrations/models/integration.js.map +1 -1
  41. package/dist/plus/integrations/models/issueRelationships.d.ts +31 -0
  42. package/dist/plus/integrations/models/issueRelationships.js +0 -0
  43. package/dist/plus/integrations/models/workItemWrites.d.ts +34 -2
  44. package/dist/plus/integrations/providers/azure/azure.js +1 -1
  45. package/dist/plus/integrations/providers/azureDevOps.d.ts +4 -3
  46. package/dist/plus/integrations/providers/azureDevOps.js +6 -6
  47. package/dist/plus/integrations/providers/azureDevOps.js.map +1 -1
  48. package/dist/plus/integrations/providers/azureDevOpsServer.d.ts +3 -0
  49. package/dist/plus/integrations/providers/azureDevOpsServer.js +14 -0
  50. package/dist/plus/integrations/providers/azureDevOpsServer.js.map +1 -1
  51. package/dist/plus/integrations/providers/azureWorkItemWriteErrors.d.ts +4 -0
  52. package/dist/plus/integrations/providers/azureWorkItemWriteErrors.js +34 -2
  53. package/dist/plus/integrations/providers/azureWorkItemWriteErrors.js.map +1 -1
  54. package/dist/plus/integrations/providers/azureWorkItemWrites.d.ts +5 -2
  55. package/dist/plus/integrations/providers/azureWorkItemWrites.js +57 -14
  56. package/dist/plus/integrations/providers/azureWorkItemWrites.js.map +1 -1
  57. package/dist/plus/integrations/providers/github.d.ts +8 -0
  58. package/dist/plus/integrations/providers/github.js +162 -2
  59. package/dist/plus/integrations/providers/github.js.map +1 -1
  60. package/dist/plus/integrations/providers/providerApiClient.d.ts +1 -1
  61. package/dist/plus/integrations/providers/providerApiClient.js +33 -14
  62. package/dist/plus/integrations/providers/providerApiClient.js.map +1 -1
  63. package/dist/plus/integrations/providers/providerErrors.d.ts +1 -0
  64. package/dist/plus/integrations/providers/providerErrors.js +1 -2
  65. package/dist/plus/integrations/providers/providerErrors.js.map +1 -1
  66. package/dist/plus/integrations/providers/providersApi.d.ts +10 -4
  67. package/dist/plus/integrations/providers/providersApi.js +21 -0
  68. package/dist/plus/integrations/providers/providersApi.js.map +1 -1
  69. package/dist/utils/env/node/exec.js +2 -2
  70. package/docs/integrations.md +61 -0
  71. package/package.json +2 -2
@@ -1,10 +1,10 @@
1
1
  import { getScopedLogger, maybeStartScopedLogger } from "../../logger.scoped.js";
2
2
  import { isWindows } from "./platform.js";
3
3
  import { join } from "path";
4
- import { stat } from "fs/promises";
5
- import * as process from "process";
6
4
  import { execFile, spawn } from "child_process";
7
5
  import { access, constants } from "fs";
6
+ import { stat } from "fs/promises";
7
+ import * as process from "process";
8
8
  //#region ../utils/src/env/node/exec.ts
9
9
  var RunError = class extends Error {
10
10
  cmd;
@@ -901,6 +901,42 @@ What holds for all of them:
901
901
  - An Asana task's tags are its labels and its likes, a thumbs-up on the task, its reactions. Its comments are stories, which a task doesn't
902
902
  count, so reading them would cost a request per task. Asana has no batch read.
903
903
 
904
+ ### GitHub.com issue relationships
905
+
906
+ Call `getIssueRelationships` with `providerId`, `connectionId` and an `issue` containing `owner`, `repo` and
907
+ `number`. Supply `expectedNodeId` on the issue to verify its identity. Set `expectedLogin` to have Core verify
908
+ the GitHub login with the selected connection. A successful read returns the canonical issue, its nullable
909
+ parent, a page of direct children, overall completion progress, and a `connectionProof`. For the next page,
910
+ repeat the original scope and pass `pageInfo.endCursor` as `cursor` and the proof as `expectedConnectionProof`.
911
+ GitHub’s aggregate completion count on a paginated list can lag a recent write.
912
+
913
+ Call `writeIssueRelationship` with the same connection, an action, and `parent` and `child` targets. Every write
914
+ target includes its repository owner, repository name, issue number and `expectedNodeId`. Use `add` to attach
915
+ an issue, `remove` to detach it, or `reorder` with a pinned sibling in either `placement.before` or
916
+ `placement.after`. GitHub enforces the credential's permissions at write time. Hosts with their own account
917
+ session can pass a synchronous currency check as the second argument to either method. Core checks
918
+ it alongside the GitHub credential before each mutation, including the attach that follows a detach.
919
+
920
+ Hosts that publish the result after further asynchronous work can pass `captureCurrency` as the third
921
+ argument to either method. When Core binds the selected credential it calls this callback with a
922
+ synchronous `isCurrent()` check. Run that check immediately before publishing issue details. Core withholds
923
+ a retired credential’s read results and reports a superseded write receipt as `unknown` with an `unconfirmed`
924
+ outcome. An HTTP 401 on a current credential arms recovery for the next operation.
925
+
926
+ Custom authentication providers must fire `onDidChange` synchronously whenever a credential is retired or
927
+ replaced, including sign-out followed by sign-in with the same token. Core uses that signal to retire
928
+ outstanding relationship proofs. The event has no connection ID, so a change to one host-managed account
929
+ also retires proofs for other accounts from that provider. Looking up another descriptor for the same
930
+ credential preserves its proof.
931
+
932
+ For a replacement, read the child's relationships before approval. Supply the approved old parent as
933
+ `replaceParent` on the add and return the read's `connectionProof` as `expectedConnectionProof`.
934
+ The proof expires when the selected credential changes or the manager is recreated. GitHub processes the
935
+ detach and attach separately. On failure, inspect `phase`, `outcome` and `detached`. A confirmed detach
936
+ followed by a failed attach can leave the child parentless. Refresh the child and both parents before
937
+ deciding whether to retry. GitHub can hide private resources behind a not-found response.
938
+ [GitHub GraphQL issue reference](https://docs.github.com/en/graphql/reference/issues)
939
+
904
940
  ### GitHub issue writes
905
941
 
906
942
  Use the selected GitHub connection ID from `getConfigured()` together with `providerId`, `owner`, and `repo`.
@@ -1047,6 +1083,31 @@ including one produced by the host's fetch, is `rate-limit` and never reported a
1047
1083
  confirm the result of a dispatched write, it returns `applied: 'maybe'`. Reconcile the provider state before
1048
1084
  attempting a new write.
1049
1085
 
1086
+ ### Azure DevOps Server work item writes
1087
+
1088
+ Use the same five work item methods with `providerId: GitSelfManagedHostIntegrationId.AzureDevOpsServer`.
1089
+ Pass the selected Server `connectionId` and its configured `baseUrl`, including the scheme, port and
1090
+ context path. If the connection is configured at the collection itself, retain that path in `baseUrl`.
1091
+ Set `organizationId`, `organizationName` and `collectionUrl` to the collection's ID, name and URL from
1092
+ `listOrgs`. Pass the `projectId` discovered under that collection and, for an existing item, its numeric
1093
+ `workItemId`. Core refuses a `baseUrl` or `collectionUrl` that differs from the connection's own, or that
1094
+ names an Azure DevOps Services host, before sending any request.
1095
+
1096
+ The writer uses the selected Server connection's credential. On the first options or target call, omit
1097
+ `expectedAccountId`. Pin the returned `accountId` for mutations and approvals. That ID identifies the
1098
+ authenticated user in the selected collection. The installation-level ID from `getCurrentAccount` can
1099
+ differ. Successful Server results identify the collection in `organization` and include `organization.url`.
1100
+
1101
+ Core negotiates the instance's Work Item Tracking REST version and requires the capabilities introduced
1102
+ in Azure DevOps Server 2019. It reads fields and workflow transitions from the selected project. Azure
1103
+ enforces the connection's work item scopes, project permissions and process rules at dispatch. An unknown
1104
+ delete capability means Core could not verify the project permission before dispatch.
1105
+
1106
+ Pin the resolved connection, collection, project, account, item and revision across delete confirmation.
1107
+ Core rereads the item and checks the credential before sending one recoverable DELETE. It reports success
1108
+ only when the provider confirms the approved project and the next revision. Use the same
1109
+ `target-changed` and `applied: 'maybe'` handling described above for a changed target or an uncertain result.
1110
+
1050
1111
  ### Azure DevOps Services pull request writes
1051
1112
 
1052
1113
  The following `IntegrationManager` methods and their types are exported from
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@gitkraken/core-gitlens",
3
3
  "description": "GitLens core — shared Git / AI / GitHub primitives for internal GitKraken consumption",
4
- "version": "0.51.1",
4
+ "version": "0.53.0",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "author": {
7
7
  "name": "GitKraken",
@@ -263,7 +263,7 @@
263
263
  }
264
264
  },
265
265
  "dependencies": {
266
- "@gitkraken/provider-apis": "0.70.0",
266
+ "@gitkraken/provider-apis": "0.71.0",
267
267
  "@octokit/graphql": "9.0.4",
268
268
  "@octokit/request": "10.0.14",
269
269
  "@octokit/request-error": "7.1.1",