@noldova/git.azure-devops.protocol 0.0.7 → 0.0.9
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.
- package/package.json +3 -3
- package/src/api/index.d.ts +69 -12
- package/src/models/azure-devops-names.js +7 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@noldova/git.azure-devops.protocol",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.9",
|
|
4
4
|
"description": "What the Azure DevOps module's parts share: AzureDevOpsNames, the module's id, its sign-in's and reads' method names, its sign-in's event and the capabilities it offers.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"registry": "https://registry.npmjs.org/"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@noldova/git.hosting.protocol": "0.0.
|
|
33
|
+
"@noldova/git.hosting.protocol": "0.0.9"
|
|
34
34
|
},
|
|
35
|
-
"gitHead": "
|
|
35
|
+
"gitHead": "9f5500a19b8eb3c3a4da847dc487d553243402f3"
|
|
36
36
|
}
|
package/src/api/index.d.ts
CHANGED
|
@@ -40,6 +40,51 @@ export declare class AzureDevOpsNames {
|
|
|
40
40
|
*/
|
|
41
41
|
public static readonly readSignInMethod: string;
|
|
42
42
|
|
|
43
|
+
/**
|
|
44
|
+
* The method that answers every Azure DevOps account kept on this computer as `HostAccountList` JSON, the first account first, each entry's
|
|
45
|
+
* `place` naming its organization as `dev.azure.com/<organization>`, lowercase, while it signs in or is signed in.
|
|
46
|
+
* The sign-in methods act on the first account when their payload names none: `readSignInMethod`, `cancelSignInMethod` and `signOutMethod` take
|
|
47
|
+
* nothing or `AccountQuery` JSON, and `startSignInMethod` and `signInWithTokenMethod` take an `account` beside their fields. Signing out an account
|
|
48
|
+
* other than the first removes it from the list.
|
|
49
|
+
*/
|
|
50
|
+
public static readonly readAccountsMethod: string;
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* The method that adds an account: it takes what `startSignInMethod` or `signInWithTokenMethod` takes, `{ "organization": string }` or
|
|
54
|
+
* `{ "token": string, "organization": string }`, signs the new account in that way and answers it as `HostAccountEntry` JSON, waiting in the
|
|
55
|
+
* browser or signed in. An added account that ends signed out leaves the list; one that signs in to an organization as an account already kept
|
|
56
|
+
* there ends signed out with `AlreadyKept` and leaves too. It fails as those methods do.
|
|
57
|
+
*/
|
|
58
|
+
public static readonly addAccountMethod: string;
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* The method that takes a `RepositoryQuery` as JSON and answers the account the module reads the repository with as `RepositoryAccount` JSON:
|
|
62
|
+
* the one the person chose for it while it is signed in to the repository's organization, else the first account signed in to that organization,
|
|
63
|
+
* else none. A read through a reference, which names the repository by its id, takes the account last chosen in the organization instead.
|
|
64
|
+
*/
|
|
65
|
+
public static readonly readRepositoryAccountMethod: string;
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* The method that takes an `AccountPick` as JSON, remembers the account for the repository on this computer, at most 200 repositories, and
|
|
69
|
+
* answers the account the module now reads it with as `RepositoryAccount` JSON; it fails with `NotFound` for an account it doesn't keep.
|
|
70
|
+
*/
|
|
71
|
+
public static readonly pickAccountMethod: string;
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* The method that takes `{ organization }` and answers the account the module reads and writes that organization's work items with, as
|
|
75
|
+
* `RepositoryAccount` JSON: the one last chosen for a repository of the organization while it is signed in there, else the first account signed in
|
|
76
|
+
* to it, else none; it fails with `InvalidParams` for a name that isn't an organization's.
|
|
77
|
+
*/
|
|
78
|
+
public static readonly readOrganizationAccountMethod: string;
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* The method that takes a `HostReference` as JSON and answers the account the module reads and writes that pull request or work item with, as
|
|
82
|
+
* `RepositoryAccount` JSON: for a reference whose repository a read has named, the one chosen for that repository, else the one last chosen in its
|
|
83
|
+
* organization, either while it is signed in there, else the first account signed in to the organization, else none; none for another module's
|
|
84
|
+
* reference.
|
|
85
|
+
*/
|
|
86
|
+
public static readonly readReferenceAccountMethod: string;
|
|
87
|
+
|
|
43
88
|
/**
|
|
44
89
|
* The method that takes `{ "organization": string }`, starts a sign-in with Microsoft for that organization and answers the sign-in waiting with
|
|
45
90
|
* the https address the window opens in the person's browser; the browser comes back to a listener on this computer, which then asks the
|
|
@@ -130,6 +175,7 @@ export declare class AzureDevOpsNames {
|
|
|
130
175
|
/**
|
|
131
176
|
* The method that takes a `WorkItemsQuery` as JSON and answers the work items in its scope, the signed-in person's open ones or the ones with its ids,
|
|
132
177
|
* each with its links, as a JSON array of `HostWorkItemDetail`, parents before their children; empty signed out or for another host or organization.
|
|
178
|
+
* The signed-in person's ones merge every account signed in to the organization, each naming its account while more than one is signed in.
|
|
133
179
|
*/
|
|
134
180
|
public static readonly readWorkItemsMethod: string;
|
|
135
181
|
|
|
@@ -202,7 +248,8 @@ export declare class AzureDevOpsNames {
|
|
|
202
248
|
/**
|
|
203
249
|
* `git-azure-devops.readReviewRequests`: takes a `RepositoryQuery` as JSON for a remote on Azure DevOps and answers the repository's active pull
|
|
204
250
|
* requests that list the signed-in person as a reviewer who hasn't voted, as `HostReviewRequestList` JSON, the newest first; a review asked of a
|
|
205
|
-
* group the person is in isn't among them.
|
|
251
|
+
* group the person is in isn't among them. The rows merge every account signed in to the remote's organization, each naming the account it was
|
|
252
|
+
* listed for, even with one signed in. Signed out, the signed-out list, and for another organization or host, none.
|
|
206
253
|
*/
|
|
207
254
|
public static readonly readReviewRequestsMethod: string;
|
|
208
255
|
|
|
@@ -231,25 +278,30 @@ export declare class AzureDevOpsNames {
|
|
|
231
278
|
public static readonly linkBranchMethod: string;
|
|
232
279
|
|
|
233
280
|
/**
|
|
234
|
-
* The method that takes `{ "reference": HostReference, "thread": number, "parent": number, "body": string }`, a pull
|
|
235
|
-
* of its threads, the comment the reply answers and the reply's Markdown, at most 150,000 characters, and posts the
|
|
236
|
-
* answering the new `HostComment`.
|
|
237
|
-
*
|
|
238
|
-
*
|
|
281
|
+
* The method that takes `{ "reference": HostReference, "thread": number, "parent": number, "body": string, "login"?: string }`, a pull
|
|
282
|
+
* request's reference, one of its threads, the comment the reply answers and the reply's Markdown, at most 150,000 characters, and posts the
|
|
283
|
+
* reply to the thread, answering the new `HostComment`. With `login`, it replies as that signed-in account of the pull request's organization,
|
|
284
|
+
* such as the account a review request was listed for, and fails with `Unauthorized` when no such account is signed in; without it, as the
|
|
285
|
+
* repository's account. It writes to the person's account, so it fails with `Unauthorized` for any caller but the app's main process acting for
|
|
286
|
+
* a window, where the person pressed Reply; it fails with `Unauthorized` too when the token can't write code, and with `NotFound` when Azure
|
|
287
|
+
* DevOps doesn't show the thread.
|
|
239
288
|
*/
|
|
240
289
|
public static readonly replyToThreadMethod: string;
|
|
241
290
|
|
|
242
291
|
/**
|
|
243
|
-
* The method that takes `{ "reference": HostReference, "thread": number, "state": "Active" | "Resolved" }` and sets the
|
|
244
|
-
* Azure DevOps, Resolved as fixed, answering null
|
|
292
|
+
* The method that takes `{ "reference": HostReference, "thread": number, "state": "Active" | "Resolved", "login"?: string }` and sets the
|
|
293
|
+
* thread's state in Azure DevOps, Resolved as fixed, answering null, as the account `login` names when it has one, as `replyToThreadMethod`
|
|
294
|
+
* does. It fails as `replyToThreadMethod` does.
|
|
245
295
|
*/
|
|
246
296
|
public static readonly changeThreadMethod: string;
|
|
247
297
|
|
|
248
298
|
/**
|
|
249
|
-
* The method that takes `{ "reference": HostReference, "vote": 10 | 5 | 0 | -5 | -10 }` and sets the signed-in person's vote on
|
|
250
|
-
* in Azure DevOps, adding them as a reviewer when they aren't one: 10 approves, 5 approves with suggestions, 0 resets the vote, -5
|
|
251
|
-
* author and -10 rejects.
|
|
252
|
-
*
|
|
299
|
+
* The method that takes `{ "reference": HostReference, "vote": 10 | 5 | 0 | -5 | -10, "login"?: string }` and sets the signed-in person's vote on
|
|
300
|
+
* the pull request in Azure DevOps, adding them as a reviewer when they aren't one: 10 approves, 5 approves with suggestions, 0 resets the vote, -5
|
|
301
|
+
* waits for the author and -10 rejects. With `login`, it votes as that signed-in account of the pull request's organization, such as the account a
|
|
302
|
+
* review request was listed for, and fails with `Unauthorized` when no such account is signed in; without it, as the repository's account. It
|
|
303
|
+
* answers the person as `HostReviewer` JSON. It fails as `replyToThreadMethod` does, and with `NotFound` when Azure DevOps doesn't show the pull
|
|
304
|
+
* request.
|
|
253
305
|
*/
|
|
254
306
|
public static readonly voteMethod: string;
|
|
255
307
|
|
|
@@ -313,6 +365,11 @@ export declare class AzureDevOpsNames {
|
|
|
313
365
|
*/
|
|
314
366
|
public static readonly signInChangedEvent: string;
|
|
315
367
|
|
|
368
|
+
/**
|
|
369
|
+
* The event that carries every account as `HostAccountList` JSON each time one is added, signs in, signs out or leaves.
|
|
370
|
+
*/
|
|
371
|
+
public static readonly accountsChangedEvent: string;
|
|
372
|
+
|
|
316
373
|
/**
|
|
317
374
|
* What the module offers today: a sign-in, reading a pull request and a branch's pull request, checks, votes, policies, builds, a pull
|
|
318
375
|
* request that completes by itself, work items, authors' pictures and a repository's open pull requests.
|
|
@@ -42,7 +42,14 @@ export class AzureDevOpsNames {
|
|
|
42
42
|
static abandonPullRequestMethod = "git-azure-devops.abandonPullRequest";
|
|
43
43
|
static searchPeopleMethod = "git-azure-devops.searchPeople";
|
|
44
44
|
static addReviewerMethod = "git-azure-devops.addReviewer";
|
|
45
|
+
static readAccountsMethod = HostingNames.nameOf(AzureDevOpsNames.moduleId, HostingNames.readAccountsMethod);
|
|
46
|
+
static addAccountMethod = HostingNames.nameOf(AzureDevOpsNames.moduleId, HostingNames.addAccountMethod);
|
|
47
|
+
static readRepositoryAccountMethod = HostingNames.nameOf(AzureDevOpsNames.moduleId, HostingNames.readRepositoryAccountMethod);
|
|
48
|
+
static pickAccountMethod = HostingNames.nameOf(AzureDevOpsNames.moduleId, HostingNames.pickAccountMethod);
|
|
49
|
+
static readOrganizationAccountMethod = "git-azure-devops.readOrganizationAccount";
|
|
50
|
+
static readReferenceAccountMethod = "git-azure-devops.readReferenceAccount";
|
|
45
51
|
static signInChangedEvent = HostingNames.nameOf(AzureDevOpsNames.moduleId, HostingNames.signInChangedEvent);
|
|
52
|
+
static accountsChangedEvent = HostingNames.nameOf(AzureDevOpsNames.moduleId, HostingNames.accountsChangedEvent);
|
|
46
53
|
static capabilities = new HostCapabilities([HostCapability.SignIn, HostCapability.ReadItem,
|
|
47
54
|
HostCapability.BranchPullRequest, HostCapability.Checks, HostCapability.Votes, HostCapability.Policies, HostCapability.Builds,
|
|
48
55
|
HostCapability.AutoComplete, HostCapability.WorkItems, HostCapability.AuthorAvatars, HostCapability.PullRequests]);
|