@gitkraken/core-gitlens 0.49.0 → 0.50.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 (30) hide show
  1. package/CHANGELOG.md +8 -1
  2. package/dist/plus/integrations/authentication/integrationAuthenticationService.d.ts +1 -0
  3. package/dist/plus/integrations/authentication/integrationAuthenticationService.js +3 -0
  4. package/dist/plus/integrations/authentication/integrationAuthenticationService.js.map +1 -1
  5. package/dist/plus/integrations/index.d.ts +3 -2
  6. package/dist/plus/integrations/index.js.map +1 -1
  7. package/dist/plus/integrations/integrationService.d.ts +9 -0
  8. package/dist/plus/integrations/integrationService.js +43 -0
  9. package/dist/plus/integrations/integrationService.js.map +1 -1
  10. package/dist/plus/integrations/manager.d.ts +6 -0
  11. package/dist/plus/integrations/models/workItemWrites.d.ts +136 -0
  12. package/dist/plus/integrations/models/workItemWrites.js +0 -0
  13. package/dist/plus/integrations/providers/azure/workItemWriteMetadata.d.ts +38 -0
  14. package/dist/plus/integrations/providers/azure/workItemWriteMetadata.js +73 -0
  15. package/dist/plus/integrations/providers/azure/workItemWriteMetadata.js.map +1 -0
  16. package/dist/plus/integrations/providers/azureDevOps.d.ts +3 -0
  17. package/dist/plus/integrations/providers/azureDevOps.js +12 -1
  18. package/dist/plus/integrations/providers/azureDevOps.js.map +1 -1
  19. package/dist/plus/integrations/providers/azureDevOpsServer.d.ts +1 -1
  20. package/dist/plus/integrations/providers/azureWorkItemWriteErrors.d.ts +17 -0
  21. package/dist/plus/integrations/providers/azureWorkItemWriteErrors.js +100 -0
  22. package/dist/plus/integrations/providers/azureWorkItemWriteErrors.js.map +1 -0
  23. package/dist/plus/integrations/providers/azureWorkItemWrites.d.ts +38 -0
  24. package/dist/plus/integrations/providers/azureWorkItemWrites.js +442 -0
  25. package/dist/plus/integrations/providers/azureWorkItemWrites.js.map +1 -0
  26. package/dist/plus/integrations/providers/providersApi.d.ts +4 -1
  27. package/dist/plus/integrations/providers/providersApi.js +7 -0
  28. package/dist/plus/integrations/providers/providersApi.js.map +1 -1
  29. package/docs/integrations.md +64 -0
  30. package/package.json +1 -1
@@ -983,6 +983,70 @@ credential. `mutationDispatched: false` means Core stopped before sending the wr
983
983
  `applied: 'maybe'` as uncertain and reconcile the issue state before retrying. A successful delete
984
984
  requires Jira's `204` acknowledgement. Jira can also return `404` when visibility changes. [Jira Cloud REST v2 issue operations](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-issues/)
985
985
 
986
+ ### Azure DevOps Services work item writes
987
+
988
+ Use the work item methods on `IntegrationManager` from `@gitkraken/core-gitlens/plus/integrations/index.js`.
989
+ Every request names `GitCloudHostIntegrationId.AzureDevOps`, the selected `connectionId`, the Azure
990
+ `organizationId` and `organizationName`, and the `projectId`. Use the IDs and names returned by
991
+ Azure discovery. Existing-item operations also take a numeric `workItemId` scoped to that organization
992
+ and project.
993
+
994
+ | Method | Additional input | Success |
995
+ | ---------------------------- | -------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------ |
996
+ | `getWorkItemCreateOptions` | Optional `workItemType` (Azure type name) | Enabled type names, or the selected type's fields, states, initial states and optional `bodyField`. |
997
+ | `getWorkItemWriteOptions` | `workItemId` | Current work item with revision, editable fields, candidate states, optional `bodyField` and delete capability. |
998
+ | `writeWorkItem` | `action: 'create'`, `workItemType`, `expectedAccountId`, `fields` | Created work item. |
999
+ | `writeWorkItem` | `action: 'edit'`, `workItemId`, `expectedAccountId`, `expectedRevision`, `fields` | Updated work item. |
1000
+ | `writeWorkItem` | `action: 'set-state'`, `workItemId`, `expectedAccountId`, `expectedRevision`, `state`, optional `fields` | Updated work item with state name and Azure category. |
1001
+ | `resolveWorkItemWriteTarget` | `workItemId`, optional `intent: 'delete'` | Canonical item and account for confirmation, with capability on delete intent. |
1002
+ | `deleteWorkItem` | `workItemId`, `expectedAccountId`, `expectedRevision` | Confirmed Recycle Bin result with `disposition: 'recycle-bin'`, `restorable: true`, `revision` and optional `deletedAt`. |
1003
+
1004
+ Pass the verified `accountId` returned by the options or target call as `expectedAccountId`. It is the Azure
1005
+ profile ID. The organization-local member ID used for viewer filters has a different purpose. Core resolves
1006
+ the selected read connection, checks the live Azure profile and the organization/project coordinates, and
1007
+ rechecks that the selected connection's credential is unchanged before dispatch. A profile that doesn't match
1008
+ `expectedAccountId` returns `no-connection`. Azure DevOps Services work item writes require an OAuth or Entra
1009
+ credential that can read the live Azure profile. Core returns `unsupported` without sending a request to
1010
+ Azure when the selected session has `type: 'pat'`. Before dispatch, an HTTP 401 or 403 that names a missing
1011
+ scope returns `insufficient-scope`, any other HTTP 401 or a sign-in page returns `no-connection`, and any
1012
+ other HTTP 403 returns `forbidden`.
1013
+
1014
+ Field keys are Azure reference names such as `System.Title` or `Custom.Sponsor`. For rich text, use the
1015
+ returned `bodyField` such as `Microsoft.VSTS.TCM.ReproSteps` when available. Options report the type's
1016
+ always-required writable fields, configured defaults and allowed values. A field without a value list has no
1017
+ `allowedValues`. Azure assigns the area and iteration when a create omits them. `System.AreaPath` and
1018
+ `System.IterationPath` are never required, and their values must be paths in the selected project. Of the
1019
+ `System.*` fields, Core accepts only `Title`, `Description`, `AssignedTo`, `Tags`, `Reason`, `History`,
1020
+ `AreaPath` and `IterationPath`; other fields follow Azure's read-only flag. Edits use `null` to clear a
1021
+ field. Send the selected state name through `set-state`. Azure applies conditional field and transition
1022
+ rules at save time. `Removed` is a workflow category that hides the item from boards, while delete moves it
1023
+ to the Recycle Bin.
1024
+
1025
+ Keep the item and revision returned by target resolution across confirmation. Edit and state changes send
1026
+ the expected revision as a JSON Patch precondition that Azure checks atomically. Azure exposes no such check
1027
+ on DELETE and doesn't enforce the project in the DELETE path. Before sending the request, Core checks the
1028
+ delete permission and test artifact types, then rereads the item for its project, revision and type, and
1029
+ rechecks the credential last. Afterwards it verifies Azure's deletion record, from the DELETE response or
1030
+ the Recycle Bin, by its item ID, project and revision. A plain success means the approved item was deleted
1031
+ at the next revision. When the record shows another project, or doesn't show exactly the next revision, the
1032
+ result is `{ ok: false, reason: 'target-changed', applied: true }`. It carries the deleted item's `project`
1033
+ and, when Azure reports it, its `revision` under `deleted`, and the Recycle Bin `deletion`. `deletedAt` is an
1034
+ ISO 8601 UTC timestamp, omitted when Core doesn't recognize Azure's deletion date format.
1035
+ `deleted.project.id` equals the approved project's ID when only the revision differs; it's absent when Core
1036
+ couldn't resolve the project. A missing `deleted.revision` means Azure didn't report it. Treat it as a
1037
+ confirmed deletion that Core can't match to the approved item and revision, not as a success. Core never
1038
+ sends a second DELETE, a restore or a permanent deletion. The delete capability reflects Azure's project
1039
+ permission. It's `allowed: 'unknown'` when Azure won't report the permission to the credential, and Azure
1040
+ decides at dispatch. Test artifacts use a separate Azure deletion flow and return `unsupported` for delete
1041
+ intent. Core identifies them by type and by Azure's test work item categories.
1042
+
1043
+ Failures use `IssueTrackerWriteFailure`, including Azure field errors on `invalid-input` and `conflict`
1044
+ for stale revisions. A scope refusal leaves the read connection usable. After dispatch, Azure's HTTP 401 or
1045
+ 403 is `insufficient-scope` when Azure names the missing scope and `forbidden` otherwise. An HTTP 429,
1046
+ including one produced by the host's fetch, is `rate-limit` and never reported as applied. When Core cannot
1047
+ confirm the result of a dispatched write, it returns `applied: 'maybe'`. Reconcile the provider state before
1048
+ attempting a new write.
1049
+
986
1050
  ### GitHub and GitHub Enterprise Server pull request writes
987
1051
 
988
1052
  Use `providerId: 'github'` and the `connectionId` that read the repository or pull request. Pass the
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.49.0",
4
+ "version": "0.50.0",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "author": {
7
7
  "name": "GitKraken",