@valiantys/atlassian-app 3.2.0-alpha-2 → 3.2.0-alpha-4
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/atlassian/jira/shared/data-access-user/src/lib/jira-user-service/index.cjs.js +1 -0
- package/atlassian/jira/shared/data-access-user/src/lib/jira-user-service/index.es.js +64 -0
- package/data-access-jql/index.d.ts +1 -1
- package/data-access-user/atlassian-app-data-access-user.api.json +693 -0
- package/data-access-user/atlassian-app.api.md +36 -0
- package/data-access-user/index.cjs.js +1 -0
- package/data-access-user/index.d.ts +101 -0
- package/data-access-user/index.es.js +4 -0
- package/data-access-user/tsdoc-metadata.json +11 -0
- package/package.json +6 -1
- package/valiantys-atlassian-app-3.2.0-alpha-4.tgz +0 -0
- package/valiantys-atlassian-app-3.2.0-alpha-2.tgz +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("../../../../../../../shared/util-fetch/src/lib/shared-util-fetch/index.cjs.js"),s=class s{constructor(t){this.fetchSvc=t}async getSelf(){return this.fetchSvc.fetch({url:this.fetchSvc.route`/rest/api/3/myself`,method:"GET"})}static async getUserInfoForToken(t,r,e=!1){return await o.jsonFetch(`https://api.atlassian.com/ex/jira/${t}/rest/api/3/myself${e?"?expand=groups":""}`,"GET",{Authorization:r})}async getUsersForPicker(t=""){return(await this.fetchSvc.fetch({method:"GET",url:this.fetchSvc.route`/rest/api/3/user/picker?query=${t}&maxResults=1000`})).users.filter(e=>e.accountType!=="app")}async getUserById(t){return await this.fetchSvc.fetch({method:"GET",url:this.fetchSvc.route`/rest/api/3/user?accountId=${t}`})}async getBulkUsers(t,r=1e3,e=0){const i=t.slice(0,128),a=new URLSearchParams({maxResults:r.toString(),startAt:e.toString()});return i.forEach(h=>a.append("accountId",h)),await this.fetchSvc.fetch({method:"GET",url:this.fetchSvc.route`/rest/api/3/user/bulk?${a}`})}};s.myselfUrl="/rest/api/3/myself",s.pickerUrl="/rest/api/3/user/picker",s.userUrl="/rest/api/3/user";let c=s;exports.JiraUserService=c;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { jsonFetch as o } from "../../../../../../../shared/util-fetch/src/lib/shared-util-fetch/index.es.js";
|
|
2
|
+
const e = class e {
|
|
3
|
+
constructor(t) {
|
|
4
|
+
this.fetchSvc = t;
|
|
5
|
+
}
|
|
6
|
+
async getSelf() {
|
|
7
|
+
return this.fetchSvc.fetch({
|
|
8
|
+
url: this.fetchSvc.route`/rest/api/3/myself`,
|
|
9
|
+
method: "GET"
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Get information about the current user.
|
|
14
|
+
* Can be an actual user or a service account.
|
|
15
|
+
*
|
|
16
|
+
* 3 types of auth tokens possible:
|
|
17
|
+
* Service account API Token auth header should start with 'Bearer '.
|
|
18
|
+
* User account API Token auth header should start with 'Basic '.
|
|
19
|
+
* User account JIRA 3LO token auth header should start with 'Bearer '.
|
|
20
|
+
*
|
|
21
|
+
* @param cloudId CloudId for a Jira site
|
|
22
|
+
* @param authHeader Can contain user Api Token or service account Api Token. User header must start with 'Basic ', service account header must start with 'Bearer '
|
|
23
|
+
* @param expandGroups Defaults to false. Pass true to return user's group memberships.
|
|
24
|
+
*/
|
|
25
|
+
static async getUserInfoForToken(t, r, s = !1) {
|
|
26
|
+
return await o(
|
|
27
|
+
`https://api.atlassian.com/ex/jira/${t}/rest/api/3/myself${s ? "?expand=groups" : ""}`,
|
|
28
|
+
"GET",
|
|
29
|
+
{
|
|
30
|
+
Authorization: r
|
|
31
|
+
}
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
async getUsersForPicker(t = "") {
|
|
35
|
+
return (await this.fetchSvc.fetch(
|
|
36
|
+
{
|
|
37
|
+
method: "GET",
|
|
38
|
+
url: this.fetchSvc.route`/rest/api/3/user/picker?query=${t}&maxResults=1000`
|
|
39
|
+
}
|
|
40
|
+
//TODO is this the best API to use?
|
|
41
|
+
)).users.filter((s) => s.accountType !== "app");
|
|
42
|
+
}
|
|
43
|
+
async getUserById(t) {
|
|
44
|
+
return await this.fetchSvc.fetch({
|
|
45
|
+
method: "GET",
|
|
46
|
+
url: this.fetchSvc.route`/rest/api/3/user?accountId=${t}`
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
async getBulkUsers(t, r = 1e3, s = 0) {
|
|
50
|
+
const i = t.slice(0, 128), c = new URLSearchParams({
|
|
51
|
+
maxResults: r.toString(),
|
|
52
|
+
startAt: s.toString()
|
|
53
|
+
});
|
|
54
|
+
return i.forEach((h) => c.append("accountId", h)), await this.fetchSvc.fetch({
|
|
55
|
+
method: "GET",
|
|
56
|
+
url: this.fetchSvc.route`/rest/api/3/user/bulk?${c}`
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
e.myselfUrl = "/rest/api/3/myself", e.pickerUrl = "/rest/api/3/user/picker", e.userUrl = "/rest/api/3/user";
|
|
61
|
+
let a = e;
|
|
62
|
+
export {
|
|
63
|
+
a as JiraUserService
|
|
64
|
+
};
|
|
@@ -24,7 +24,7 @@ declare type FetchRoute = {
|
|
|
24
24
|
declare type FetchSignature = <T>(request: FetchRequest, body?: any) => Promise<T>;
|
|
25
25
|
|
|
26
26
|
export declare class JqlPrecomputationService {
|
|
27
|
-
private fetchSvc;
|
|
27
|
+
private readonly fetchSvc;
|
|
28
28
|
static readonly url = "/rest/api/3/jql/function/computation";
|
|
29
29
|
/**
|
|
30
30
|
* @param fetchSvc Must be using asApp. asUser is NOT allowed on this API
|
|
@@ -0,0 +1,693 @@
|
|
|
1
|
+
{
|
|
2
|
+
"metadata": {
|
|
3
|
+
"toolPackage": "@microsoft/api-extractor",
|
|
4
|
+
"toolVersion": "7.52.8",
|
|
5
|
+
"schemaVersion": 1011,
|
|
6
|
+
"oldestForwardsCompatibleVersion": 1001,
|
|
7
|
+
"tsdocConfig": {
|
|
8
|
+
"$schema": "https://developer.microsoft.com/json-schemas/tsdoc/v0/tsdoc.schema.json",
|
|
9
|
+
"noStandardTags": true,
|
|
10
|
+
"tagDefinitions": [
|
|
11
|
+
{
|
|
12
|
+
"tagName": "@alpha",
|
|
13
|
+
"syntaxKind": "modifier"
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"tagName": "@beta",
|
|
17
|
+
"syntaxKind": "modifier"
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"tagName": "@defaultValue",
|
|
21
|
+
"syntaxKind": "block"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"tagName": "@decorator",
|
|
25
|
+
"syntaxKind": "block",
|
|
26
|
+
"allowMultiple": true
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"tagName": "@deprecated",
|
|
30
|
+
"syntaxKind": "block"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"tagName": "@eventProperty",
|
|
34
|
+
"syntaxKind": "modifier"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"tagName": "@example",
|
|
38
|
+
"syntaxKind": "block",
|
|
39
|
+
"allowMultiple": true
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
"tagName": "@experimental",
|
|
43
|
+
"syntaxKind": "modifier"
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"tagName": "@inheritDoc",
|
|
47
|
+
"syntaxKind": "inline"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"tagName": "@internal",
|
|
51
|
+
"syntaxKind": "modifier"
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"tagName": "@label",
|
|
55
|
+
"syntaxKind": "inline"
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"tagName": "@link",
|
|
59
|
+
"syntaxKind": "inline",
|
|
60
|
+
"allowMultiple": true
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
"tagName": "@override",
|
|
64
|
+
"syntaxKind": "modifier"
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
"tagName": "@packageDocumentation",
|
|
68
|
+
"syntaxKind": "modifier"
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
"tagName": "@param",
|
|
72
|
+
"syntaxKind": "block",
|
|
73
|
+
"allowMultiple": true
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
"tagName": "@privateRemarks",
|
|
77
|
+
"syntaxKind": "block"
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
"tagName": "@public",
|
|
81
|
+
"syntaxKind": "modifier"
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
"tagName": "@readonly",
|
|
85
|
+
"syntaxKind": "modifier"
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
"tagName": "@remarks",
|
|
89
|
+
"syntaxKind": "block"
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
"tagName": "@returns",
|
|
93
|
+
"syntaxKind": "block"
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
"tagName": "@sealed",
|
|
97
|
+
"syntaxKind": "modifier"
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
"tagName": "@see",
|
|
101
|
+
"syntaxKind": "block"
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
"tagName": "@throws",
|
|
105
|
+
"syntaxKind": "block",
|
|
106
|
+
"allowMultiple": true
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
"tagName": "@typeParam",
|
|
110
|
+
"syntaxKind": "block",
|
|
111
|
+
"allowMultiple": true
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
"tagName": "@virtual",
|
|
115
|
+
"syntaxKind": "modifier"
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
"tagName": "@betaDocumentation",
|
|
119
|
+
"syntaxKind": "modifier"
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
"tagName": "@internalRemarks",
|
|
123
|
+
"syntaxKind": "block"
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
"tagName": "@preapproved",
|
|
127
|
+
"syntaxKind": "modifier"
|
|
128
|
+
}
|
|
129
|
+
],
|
|
130
|
+
"supportForTags": {
|
|
131
|
+
"@alpha": true,
|
|
132
|
+
"@beta": true,
|
|
133
|
+
"@defaultValue": true,
|
|
134
|
+
"@decorator": true,
|
|
135
|
+
"@deprecated": true,
|
|
136
|
+
"@eventProperty": true,
|
|
137
|
+
"@example": true,
|
|
138
|
+
"@experimental": true,
|
|
139
|
+
"@inheritDoc": true,
|
|
140
|
+
"@internal": true,
|
|
141
|
+
"@label": true,
|
|
142
|
+
"@link": true,
|
|
143
|
+
"@override": true,
|
|
144
|
+
"@packageDocumentation": true,
|
|
145
|
+
"@param": true,
|
|
146
|
+
"@privateRemarks": true,
|
|
147
|
+
"@public": true,
|
|
148
|
+
"@readonly": true,
|
|
149
|
+
"@remarks": true,
|
|
150
|
+
"@returns": true,
|
|
151
|
+
"@sealed": true,
|
|
152
|
+
"@see": true,
|
|
153
|
+
"@throws": true,
|
|
154
|
+
"@typeParam": true,
|
|
155
|
+
"@virtual": true,
|
|
156
|
+
"@betaDocumentation": true,
|
|
157
|
+
"@internalRemarks": true,
|
|
158
|
+
"@preapproved": true
|
|
159
|
+
},
|
|
160
|
+
"reportUnsupportedHtmlElements": false
|
|
161
|
+
}
|
|
162
|
+
},
|
|
163
|
+
"kind": "Package",
|
|
164
|
+
"canonicalReference": "@valiantys/atlassian-app!",
|
|
165
|
+
"docComment": "",
|
|
166
|
+
"name": "@valiantys/atlassian-app",
|
|
167
|
+
"preserveMemberOrder": false,
|
|
168
|
+
"members": [
|
|
169
|
+
{
|
|
170
|
+
"kind": "EntryPoint",
|
|
171
|
+
"canonicalReference": "@valiantys/atlassian-app!",
|
|
172
|
+
"name": "",
|
|
173
|
+
"preserveMemberOrder": false,
|
|
174
|
+
"members": [
|
|
175
|
+
{
|
|
176
|
+
"kind": "Class",
|
|
177
|
+
"canonicalReference": "@valiantys/atlassian-app!JiraUserService:class",
|
|
178
|
+
"docComment": "",
|
|
179
|
+
"excerptTokens": [
|
|
180
|
+
{
|
|
181
|
+
"kind": "Content",
|
|
182
|
+
"text": "export declare class JiraUserService "
|
|
183
|
+
}
|
|
184
|
+
],
|
|
185
|
+
"fileUrlPath": "../../jira/shared/data-access-user/src/lib/jira-user-service.d.ts",
|
|
186
|
+
"releaseTag": "Public",
|
|
187
|
+
"isAbstract": false,
|
|
188
|
+
"name": "JiraUserService",
|
|
189
|
+
"preserveMemberOrder": false,
|
|
190
|
+
"members": [
|
|
191
|
+
{
|
|
192
|
+
"kind": "Constructor",
|
|
193
|
+
"canonicalReference": "@valiantys/atlassian-app!JiraUserService:constructor(1)",
|
|
194
|
+
"docComment": "/**\n * Constructs a new instance of the `JiraUserService` class\n */\n",
|
|
195
|
+
"excerptTokens": [
|
|
196
|
+
{
|
|
197
|
+
"kind": "Content",
|
|
198
|
+
"text": "constructor(fetchSvc: "
|
|
199
|
+
},
|
|
200
|
+
{
|
|
201
|
+
"kind": "Reference",
|
|
202
|
+
"text": "AtlassianProductFetchService",
|
|
203
|
+
"canonicalReference": "@valiantys/atlassian-app!~AtlassianProductFetchService:interface"
|
|
204
|
+
},
|
|
205
|
+
{
|
|
206
|
+
"kind": "Content",
|
|
207
|
+
"text": "<'jira'>"
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
"kind": "Content",
|
|
211
|
+
"text": ");"
|
|
212
|
+
}
|
|
213
|
+
],
|
|
214
|
+
"releaseTag": "Public",
|
|
215
|
+
"isProtected": false,
|
|
216
|
+
"overloadIndex": 1,
|
|
217
|
+
"parameters": [
|
|
218
|
+
{
|
|
219
|
+
"parameterName": "fetchSvc",
|
|
220
|
+
"parameterTypeTokenRange": {
|
|
221
|
+
"startIndex": 1,
|
|
222
|
+
"endIndex": 3
|
|
223
|
+
},
|
|
224
|
+
"isOptional": false
|
|
225
|
+
}
|
|
226
|
+
]
|
|
227
|
+
},
|
|
228
|
+
{
|
|
229
|
+
"kind": "Method",
|
|
230
|
+
"canonicalReference": "@valiantys/atlassian-app!JiraUserService#getBulkUsers:member(1)",
|
|
231
|
+
"docComment": "",
|
|
232
|
+
"excerptTokens": [
|
|
233
|
+
{
|
|
234
|
+
"kind": "Content",
|
|
235
|
+
"text": "getBulkUsers(accountIds: "
|
|
236
|
+
},
|
|
237
|
+
{
|
|
238
|
+
"kind": "Content",
|
|
239
|
+
"text": "string[]"
|
|
240
|
+
},
|
|
241
|
+
{
|
|
242
|
+
"kind": "Content",
|
|
243
|
+
"text": ", maxResults?: "
|
|
244
|
+
},
|
|
245
|
+
{
|
|
246
|
+
"kind": "Content",
|
|
247
|
+
"text": "number"
|
|
248
|
+
},
|
|
249
|
+
{
|
|
250
|
+
"kind": "Content",
|
|
251
|
+
"text": ", startAt?: "
|
|
252
|
+
},
|
|
253
|
+
{
|
|
254
|
+
"kind": "Content",
|
|
255
|
+
"text": "number"
|
|
256
|
+
},
|
|
257
|
+
{
|
|
258
|
+
"kind": "Content",
|
|
259
|
+
"text": "): "
|
|
260
|
+
},
|
|
261
|
+
{
|
|
262
|
+
"kind": "Reference",
|
|
263
|
+
"text": "Promise",
|
|
264
|
+
"canonicalReference": "!Promise:interface"
|
|
265
|
+
},
|
|
266
|
+
{
|
|
267
|
+
"kind": "Content",
|
|
268
|
+
"text": "<"
|
|
269
|
+
},
|
|
270
|
+
{
|
|
271
|
+
"kind": "Reference",
|
|
272
|
+
"text": "PagedUsers",
|
|
273
|
+
"canonicalReference": "@valiantys/atlassian-app!~PagedUsers:type"
|
|
274
|
+
},
|
|
275
|
+
{
|
|
276
|
+
"kind": "Content",
|
|
277
|
+
"text": ">"
|
|
278
|
+
},
|
|
279
|
+
{
|
|
280
|
+
"kind": "Content",
|
|
281
|
+
"text": ";"
|
|
282
|
+
}
|
|
283
|
+
],
|
|
284
|
+
"isStatic": false,
|
|
285
|
+
"returnTypeTokenRange": {
|
|
286
|
+
"startIndex": 7,
|
|
287
|
+
"endIndex": 11
|
|
288
|
+
},
|
|
289
|
+
"releaseTag": "Public",
|
|
290
|
+
"isProtected": false,
|
|
291
|
+
"overloadIndex": 1,
|
|
292
|
+
"parameters": [
|
|
293
|
+
{
|
|
294
|
+
"parameterName": "accountIds",
|
|
295
|
+
"parameterTypeTokenRange": {
|
|
296
|
+
"startIndex": 1,
|
|
297
|
+
"endIndex": 2
|
|
298
|
+
},
|
|
299
|
+
"isOptional": false
|
|
300
|
+
},
|
|
301
|
+
{
|
|
302
|
+
"parameterName": "maxResults",
|
|
303
|
+
"parameterTypeTokenRange": {
|
|
304
|
+
"startIndex": 3,
|
|
305
|
+
"endIndex": 4
|
|
306
|
+
},
|
|
307
|
+
"isOptional": true
|
|
308
|
+
},
|
|
309
|
+
{
|
|
310
|
+
"parameterName": "startAt",
|
|
311
|
+
"parameterTypeTokenRange": {
|
|
312
|
+
"startIndex": 5,
|
|
313
|
+
"endIndex": 6
|
|
314
|
+
},
|
|
315
|
+
"isOptional": true
|
|
316
|
+
}
|
|
317
|
+
],
|
|
318
|
+
"isOptional": false,
|
|
319
|
+
"isAbstract": false,
|
|
320
|
+
"name": "getBulkUsers"
|
|
321
|
+
},
|
|
322
|
+
{
|
|
323
|
+
"kind": "Method",
|
|
324
|
+
"canonicalReference": "@valiantys/atlassian-app!JiraUserService#getSelf:member(1)",
|
|
325
|
+
"docComment": "",
|
|
326
|
+
"excerptTokens": [
|
|
327
|
+
{
|
|
328
|
+
"kind": "Content",
|
|
329
|
+
"text": "getSelf(): "
|
|
330
|
+
},
|
|
331
|
+
{
|
|
332
|
+
"kind": "Reference",
|
|
333
|
+
"text": "Promise",
|
|
334
|
+
"canonicalReference": "!Promise:interface"
|
|
335
|
+
},
|
|
336
|
+
{
|
|
337
|
+
"kind": "Content",
|
|
338
|
+
"text": "<"
|
|
339
|
+
},
|
|
340
|
+
{
|
|
341
|
+
"kind": "Reference",
|
|
342
|
+
"text": "User",
|
|
343
|
+
"canonicalReference": "@valiantys/atlassian-app!~User:interface"
|
|
344
|
+
},
|
|
345
|
+
{
|
|
346
|
+
"kind": "Content",
|
|
347
|
+
"text": ">"
|
|
348
|
+
},
|
|
349
|
+
{
|
|
350
|
+
"kind": "Content",
|
|
351
|
+
"text": ";"
|
|
352
|
+
}
|
|
353
|
+
],
|
|
354
|
+
"isStatic": false,
|
|
355
|
+
"returnTypeTokenRange": {
|
|
356
|
+
"startIndex": 1,
|
|
357
|
+
"endIndex": 5
|
|
358
|
+
},
|
|
359
|
+
"releaseTag": "Public",
|
|
360
|
+
"isProtected": false,
|
|
361
|
+
"overloadIndex": 1,
|
|
362
|
+
"parameters": [],
|
|
363
|
+
"isOptional": false,
|
|
364
|
+
"isAbstract": false,
|
|
365
|
+
"name": "getSelf"
|
|
366
|
+
},
|
|
367
|
+
{
|
|
368
|
+
"kind": "Method",
|
|
369
|
+
"canonicalReference": "@valiantys/atlassian-app!JiraUserService#getUserById:member(1)",
|
|
370
|
+
"docComment": "",
|
|
371
|
+
"excerptTokens": [
|
|
372
|
+
{
|
|
373
|
+
"kind": "Content",
|
|
374
|
+
"text": "getUserById(accountId: "
|
|
375
|
+
},
|
|
376
|
+
{
|
|
377
|
+
"kind": "Content",
|
|
378
|
+
"text": "string"
|
|
379
|
+
},
|
|
380
|
+
{
|
|
381
|
+
"kind": "Content",
|
|
382
|
+
"text": "): "
|
|
383
|
+
},
|
|
384
|
+
{
|
|
385
|
+
"kind": "Reference",
|
|
386
|
+
"text": "Promise",
|
|
387
|
+
"canonicalReference": "!Promise:interface"
|
|
388
|
+
},
|
|
389
|
+
{
|
|
390
|
+
"kind": "Content",
|
|
391
|
+
"text": "<"
|
|
392
|
+
},
|
|
393
|
+
{
|
|
394
|
+
"kind": "Reference",
|
|
395
|
+
"text": "User",
|
|
396
|
+
"canonicalReference": "@valiantys/atlassian-app!~User:interface"
|
|
397
|
+
},
|
|
398
|
+
{
|
|
399
|
+
"kind": "Content",
|
|
400
|
+
"text": ">"
|
|
401
|
+
},
|
|
402
|
+
{
|
|
403
|
+
"kind": "Content",
|
|
404
|
+
"text": ";"
|
|
405
|
+
}
|
|
406
|
+
],
|
|
407
|
+
"isStatic": false,
|
|
408
|
+
"returnTypeTokenRange": {
|
|
409
|
+
"startIndex": 3,
|
|
410
|
+
"endIndex": 7
|
|
411
|
+
},
|
|
412
|
+
"releaseTag": "Public",
|
|
413
|
+
"isProtected": false,
|
|
414
|
+
"overloadIndex": 1,
|
|
415
|
+
"parameters": [
|
|
416
|
+
{
|
|
417
|
+
"parameterName": "accountId",
|
|
418
|
+
"parameterTypeTokenRange": {
|
|
419
|
+
"startIndex": 1,
|
|
420
|
+
"endIndex": 2
|
|
421
|
+
},
|
|
422
|
+
"isOptional": false
|
|
423
|
+
}
|
|
424
|
+
],
|
|
425
|
+
"isOptional": false,
|
|
426
|
+
"isAbstract": false,
|
|
427
|
+
"name": "getUserById"
|
|
428
|
+
},
|
|
429
|
+
{
|
|
430
|
+
"kind": "Method",
|
|
431
|
+
"canonicalReference": "@valiantys/atlassian-app!JiraUserService.getUserInfoForToken:member(1)",
|
|
432
|
+
"docComment": "/**\n * Get information about the current user. Can be an actual user or a service account.\n *\n * 3 types of auth tokens possible: Service account API Token auth header should start with 'Bearer '. User account API Token auth header should start with 'Basic '. User account JIRA 3LO token auth header should start with 'Bearer '.\n *\n * @param cloudId - CloudId for a Jira site\n *\n * @param authHeader - Can contain user Api Token or service account Api Token. User header must start with 'Basic ', service account header must start with 'Bearer '\n *\n * @param expandGroups - Defaults to false. Pass true to return user's group memberships.\n */\n",
|
|
433
|
+
"excerptTokens": [
|
|
434
|
+
{
|
|
435
|
+
"kind": "Content",
|
|
436
|
+
"text": "static getUserInfoForToken(cloudId: "
|
|
437
|
+
},
|
|
438
|
+
{
|
|
439
|
+
"kind": "Content",
|
|
440
|
+
"text": "string"
|
|
441
|
+
},
|
|
442
|
+
{
|
|
443
|
+
"kind": "Content",
|
|
444
|
+
"text": ", authHeader: "
|
|
445
|
+
},
|
|
446
|
+
{
|
|
447
|
+
"kind": "Content",
|
|
448
|
+
"text": "string"
|
|
449
|
+
},
|
|
450
|
+
{
|
|
451
|
+
"kind": "Content",
|
|
452
|
+
"text": ", expandGroups?: "
|
|
453
|
+
},
|
|
454
|
+
{
|
|
455
|
+
"kind": "Content",
|
|
456
|
+
"text": "boolean"
|
|
457
|
+
},
|
|
458
|
+
{
|
|
459
|
+
"kind": "Content",
|
|
460
|
+
"text": "): "
|
|
461
|
+
},
|
|
462
|
+
{
|
|
463
|
+
"kind": "Reference",
|
|
464
|
+
"text": "Promise",
|
|
465
|
+
"canonicalReference": "!Promise:interface"
|
|
466
|
+
},
|
|
467
|
+
{
|
|
468
|
+
"kind": "Content",
|
|
469
|
+
"text": "<"
|
|
470
|
+
},
|
|
471
|
+
{
|
|
472
|
+
"kind": "Reference",
|
|
473
|
+
"text": "User",
|
|
474
|
+
"canonicalReference": "@valiantys/atlassian-app!~User:interface"
|
|
475
|
+
},
|
|
476
|
+
{
|
|
477
|
+
"kind": "Content",
|
|
478
|
+
"text": ">"
|
|
479
|
+
},
|
|
480
|
+
{
|
|
481
|
+
"kind": "Content",
|
|
482
|
+
"text": ";"
|
|
483
|
+
}
|
|
484
|
+
],
|
|
485
|
+
"isStatic": true,
|
|
486
|
+
"returnTypeTokenRange": {
|
|
487
|
+
"startIndex": 7,
|
|
488
|
+
"endIndex": 11
|
|
489
|
+
},
|
|
490
|
+
"releaseTag": "Public",
|
|
491
|
+
"isProtected": false,
|
|
492
|
+
"overloadIndex": 1,
|
|
493
|
+
"parameters": [
|
|
494
|
+
{
|
|
495
|
+
"parameterName": "cloudId",
|
|
496
|
+
"parameterTypeTokenRange": {
|
|
497
|
+
"startIndex": 1,
|
|
498
|
+
"endIndex": 2
|
|
499
|
+
},
|
|
500
|
+
"isOptional": false
|
|
501
|
+
},
|
|
502
|
+
{
|
|
503
|
+
"parameterName": "authHeader",
|
|
504
|
+
"parameterTypeTokenRange": {
|
|
505
|
+
"startIndex": 3,
|
|
506
|
+
"endIndex": 4
|
|
507
|
+
},
|
|
508
|
+
"isOptional": false
|
|
509
|
+
},
|
|
510
|
+
{
|
|
511
|
+
"parameterName": "expandGroups",
|
|
512
|
+
"parameterTypeTokenRange": {
|
|
513
|
+
"startIndex": 5,
|
|
514
|
+
"endIndex": 6
|
|
515
|
+
},
|
|
516
|
+
"isOptional": true
|
|
517
|
+
}
|
|
518
|
+
],
|
|
519
|
+
"isOptional": false,
|
|
520
|
+
"isAbstract": false,
|
|
521
|
+
"name": "getUserInfoForToken"
|
|
522
|
+
},
|
|
523
|
+
{
|
|
524
|
+
"kind": "Method",
|
|
525
|
+
"canonicalReference": "@valiantys/atlassian-app!JiraUserService#getUsersForPicker:member(1)",
|
|
526
|
+
"docComment": "",
|
|
527
|
+
"excerptTokens": [
|
|
528
|
+
{
|
|
529
|
+
"kind": "Content",
|
|
530
|
+
"text": "getUsersForPicker(searchString?: "
|
|
531
|
+
},
|
|
532
|
+
{
|
|
533
|
+
"kind": "Content",
|
|
534
|
+
"text": "string"
|
|
535
|
+
},
|
|
536
|
+
{
|
|
537
|
+
"kind": "Content",
|
|
538
|
+
"text": "): "
|
|
539
|
+
},
|
|
540
|
+
{
|
|
541
|
+
"kind": "Reference",
|
|
542
|
+
"text": "Promise",
|
|
543
|
+
"canonicalReference": "!Promise:interface"
|
|
544
|
+
},
|
|
545
|
+
{
|
|
546
|
+
"kind": "Content",
|
|
547
|
+
"text": "<import('../../../util-jira-v3-api/src/index.ts')."
|
|
548
|
+
},
|
|
549
|
+
{
|
|
550
|
+
"kind": "Reference",
|
|
551
|
+
"text": "UserPickerUser",
|
|
552
|
+
"canonicalReference": "@valiantys/atlassian-app!~UserPickerUser:interface"
|
|
553
|
+
},
|
|
554
|
+
{
|
|
555
|
+
"kind": "Content",
|
|
556
|
+
"text": "[]>"
|
|
557
|
+
},
|
|
558
|
+
{
|
|
559
|
+
"kind": "Content",
|
|
560
|
+
"text": ";"
|
|
561
|
+
}
|
|
562
|
+
],
|
|
563
|
+
"isStatic": false,
|
|
564
|
+
"returnTypeTokenRange": {
|
|
565
|
+
"startIndex": 3,
|
|
566
|
+
"endIndex": 7
|
|
567
|
+
},
|
|
568
|
+
"releaseTag": "Public",
|
|
569
|
+
"isProtected": false,
|
|
570
|
+
"overloadIndex": 1,
|
|
571
|
+
"parameters": [
|
|
572
|
+
{
|
|
573
|
+
"parameterName": "searchString",
|
|
574
|
+
"parameterTypeTokenRange": {
|
|
575
|
+
"startIndex": 1,
|
|
576
|
+
"endIndex": 2
|
|
577
|
+
},
|
|
578
|
+
"isOptional": true
|
|
579
|
+
}
|
|
580
|
+
],
|
|
581
|
+
"isOptional": false,
|
|
582
|
+
"isAbstract": false,
|
|
583
|
+
"name": "getUsersForPicker"
|
|
584
|
+
},
|
|
585
|
+
{
|
|
586
|
+
"kind": "Property",
|
|
587
|
+
"canonicalReference": "@valiantys/atlassian-app!JiraUserService.myselfUrl:member",
|
|
588
|
+
"docComment": "",
|
|
589
|
+
"excerptTokens": [
|
|
590
|
+
{
|
|
591
|
+
"kind": "Content",
|
|
592
|
+
"text": "static readonly myselfUrl = "
|
|
593
|
+
},
|
|
594
|
+
{
|
|
595
|
+
"kind": "Content",
|
|
596
|
+
"text": "\"/rest/api/3/myself\""
|
|
597
|
+
},
|
|
598
|
+
{
|
|
599
|
+
"kind": "Content",
|
|
600
|
+
"text": ";"
|
|
601
|
+
}
|
|
602
|
+
],
|
|
603
|
+
"isReadonly": true,
|
|
604
|
+
"isOptional": false,
|
|
605
|
+
"releaseTag": "Public",
|
|
606
|
+
"name": "myselfUrl",
|
|
607
|
+
"propertyTypeTokenRange": {
|
|
608
|
+
"startIndex": 0,
|
|
609
|
+
"endIndex": 0
|
|
610
|
+
},
|
|
611
|
+
"initializerTokenRange": {
|
|
612
|
+
"startIndex": 1,
|
|
613
|
+
"endIndex": 2
|
|
614
|
+
},
|
|
615
|
+
"isStatic": true,
|
|
616
|
+
"isProtected": false,
|
|
617
|
+
"isAbstract": false
|
|
618
|
+
},
|
|
619
|
+
{
|
|
620
|
+
"kind": "Property",
|
|
621
|
+
"canonicalReference": "@valiantys/atlassian-app!JiraUserService.pickerUrl:member",
|
|
622
|
+
"docComment": "",
|
|
623
|
+
"excerptTokens": [
|
|
624
|
+
{
|
|
625
|
+
"kind": "Content",
|
|
626
|
+
"text": "static readonly pickerUrl = "
|
|
627
|
+
},
|
|
628
|
+
{
|
|
629
|
+
"kind": "Content",
|
|
630
|
+
"text": "\"/rest/api/3/user/picker\""
|
|
631
|
+
},
|
|
632
|
+
{
|
|
633
|
+
"kind": "Content",
|
|
634
|
+
"text": ";"
|
|
635
|
+
}
|
|
636
|
+
],
|
|
637
|
+
"isReadonly": true,
|
|
638
|
+
"isOptional": false,
|
|
639
|
+
"releaseTag": "Public",
|
|
640
|
+
"name": "pickerUrl",
|
|
641
|
+
"propertyTypeTokenRange": {
|
|
642
|
+
"startIndex": 0,
|
|
643
|
+
"endIndex": 0
|
|
644
|
+
},
|
|
645
|
+
"initializerTokenRange": {
|
|
646
|
+
"startIndex": 1,
|
|
647
|
+
"endIndex": 2
|
|
648
|
+
},
|
|
649
|
+
"isStatic": true,
|
|
650
|
+
"isProtected": false,
|
|
651
|
+
"isAbstract": false
|
|
652
|
+
},
|
|
653
|
+
{
|
|
654
|
+
"kind": "Property",
|
|
655
|
+
"canonicalReference": "@valiantys/atlassian-app!JiraUserService.userUrl:member",
|
|
656
|
+
"docComment": "",
|
|
657
|
+
"excerptTokens": [
|
|
658
|
+
{
|
|
659
|
+
"kind": "Content",
|
|
660
|
+
"text": "static readonly userUrl = "
|
|
661
|
+
},
|
|
662
|
+
{
|
|
663
|
+
"kind": "Content",
|
|
664
|
+
"text": "\"/rest/api/3/user\""
|
|
665
|
+
},
|
|
666
|
+
{
|
|
667
|
+
"kind": "Content",
|
|
668
|
+
"text": ";"
|
|
669
|
+
}
|
|
670
|
+
],
|
|
671
|
+
"isReadonly": true,
|
|
672
|
+
"isOptional": false,
|
|
673
|
+
"releaseTag": "Public",
|
|
674
|
+
"name": "userUrl",
|
|
675
|
+
"propertyTypeTokenRange": {
|
|
676
|
+
"startIndex": 0,
|
|
677
|
+
"endIndex": 0
|
|
678
|
+
},
|
|
679
|
+
"initializerTokenRange": {
|
|
680
|
+
"startIndex": 1,
|
|
681
|
+
"endIndex": 2
|
|
682
|
+
},
|
|
683
|
+
"isStatic": true,
|
|
684
|
+
"isProtected": false,
|
|
685
|
+
"isAbstract": false
|
|
686
|
+
}
|
|
687
|
+
],
|
|
688
|
+
"implementsTokenRanges": []
|
|
689
|
+
}
|
|
690
|
+
]
|
|
691
|
+
}
|
|
692
|
+
]
|
|
693
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
## API Report File for "@valiantys/atlassian-app"
|
|
2
|
+
|
|
3
|
+
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
|
|
7
|
+
// @public (undocumented)
|
|
8
|
+
export class JiraUserService {
|
|
9
|
+
// Warning: (ae-forgotten-export) The symbol "AtlassianProductFetchService" needs to be exported by the entry point data-access-user.d.ts
|
|
10
|
+
constructor(fetchSvc: AtlassianProductFetchService<'jira'>);
|
|
11
|
+
// Warning: (ae-forgotten-export) The symbol "PagedUsers" needs to be exported by the entry point data-access-user.d.ts
|
|
12
|
+
//
|
|
13
|
+
// (undocumented)
|
|
14
|
+
getBulkUsers(accountIds: string[], maxResults?: number, startAt?: number): Promise<PagedUsers>;
|
|
15
|
+
// Warning: (ae-forgotten-export) The symbol "User" needs to be exported by the entry point data-access-user.d.ts
|
|
16
|
+
//
|
|
17
|
+
// (undocumented)
|
|
18
|
+
getSelf(): Promise<User>;
|
|
19
|
+
// (undocumented)
|
|
20
|
+
getUserById(accountId: string): Promise<User>;
|
|
21
|
+
static getUserInfoForToken(cloudId: string, authHeader: string, expandGroups?: boolean): Promise<User>;
|
|
22
|
+
// Warning: (ae-forgotten-export) The symbol "UserPickerUser" needs to be exported by the entry point data-access-user.d.ts
|
|
23
|
+
//
|
|
24
|
+
// (undocumented)
|
|
25
|
+
getUsersForPicker(searchString?: string): Promise<UserPickerUser[]>;
|
|
26
|
+
// (undocumented)
|
|
27
|
+
static readonly myselfUrl = "/rest/api/3/myself";
|
|
28
|
+
// (undocumented)
|
|
29
|
+
static readonly pickerUrl = "/rest/api/3/user/picker";
|
|
30
|
+
// (undocumented)
|
|
31
|
+
static readonly userUrl = "/rest/api/3/user";
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
// (No @packageDocumentation comment for this package)
|
|
35
|
+
|
|
36
|
+
```
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../atlassian/jira/shared/data-access-user/src/lib/jira-user-service/index.cjs.js");exports.JiraUserService=e.JiraUserService;
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
declare type APIResponse = Pick<Response, 'json' | 'text' | 'ok' | 'status' | 'statusText' | 'headers'>;
|
|
2
|
+
|
|
3
|
+
declare interface AtlassianProductFetchService<P extends Product> {
|
|
4
|
+
productType: P;
|
|
5
|
+
fetch: FetchSignature;
|
|
6
|
+
route: (template: TemplateStringsArray, ...parameters: (string | number | URLSearchParams | FetchRoute)[]) => FetchRoute;
|
|
7
|
+
rawFetch: RequestProductMethod;
|
|
8
|
+
fullUrl: (path: string) => string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
declare interface AvatarUrls {
|
|
12
|
+
'48x48': string;
|
|
13
|
+
'24x24': string;
|
|
14
|
+
'16x16': string;
|
|
15
|
+
'32x32': string;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
declare type FetchMethod = 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH';
|
|
19
|
+
|
|
20
|
+
declare interface FetchRequest {
|
|
21
|
+
method: FetchMethod;
|
|
22
|
+
url: FetchRoute;
|
|
23
|
+
responseType?: 'json' | 'text';
|
|
24
|
+
allowExperimental?: boolean;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
declare type FetchRoute = {
|
|
28
|
+
readonly value: string;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
declare type FetchSignature = <T>(request: FetchRequest, body?: any) => Promise<T>;
|
|
32
|
+
|
|
33
|
+
export declare class JiraUserService {
|
|
34
|
+
private readonly fetchSvc;
|
|
35
|
+
static readonly myselfUrl = "/rest/api/3/myself";
|
|
36
|
+
static readonly pickerUrl = "/rest/api/3/user/picker";
|
|
37
|
+
static readonly userUrl = "/rest/api/3/user";
|
|
38
|
+
constructor(fetchSvc: AtlassianProductFetchService<'jira'>);
|
|
39
|
+
getSelf(): Promise<User>;
|
|
40
|
+
/**
|
|
41
|
+
* Get information about the current user.
|
|
42
|
+
* Can be an actual user or a service account.
|
|
43
|
+
*
|
|
44
|
+
* 3 types of auth tokens possible:
|
|
45
|
+
* Service account API Token auth header should start with 'Bearer '.
|
|
46
|
+
* User account API Token auth header should start with 'Basic '.
|
|
47
|
+
* User account JIRA 3LO token auth header should start with 'Bearer '.
|
|
48
|
+
*
|
|
49
|
+
* @param cloudId CloudId for a Jira site
|
|
50
|
+
* @param authHeader Can contain user Api Token or service account Api Token. User header must start with 'Basic ', service account header must start with 'Bearer '
|
|
51
|
+
* @param expandGroups Defaults to false. Pass true to return user's group memberships.
|
|
52
|
+
*/
|
|
53
|
+
static getUserInfoForToken(cloudId: string, authHeader: string, expandGroups?: boolean): Promise<User>;
|
|
54
|
+
getUsersForPicker(searchString?: string): Promise<UserPickerUser[]>;
|
|
55
|
+
getUserById(accountId: string): Promise<User>;
|
|
56
|
+
getBulkUsers(accountIds: string[], maxResults?: number, startAt?: number): Promise<PagedUsers>;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
declare interface PagedResponse<T> {
|
|
60
|
+
startAt: number;
|
|
61
|
+
isLast: boolean;
|
|
62
|
+
maxResults: number;
|
|
63
|
+
total: number;
|
|
64
|
+
values: T[];
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
declare type PagedUsers = PagedResponse<User | null>;
|
|
68
|
+
|
|
69
|
+
declare type Product = 'jira' | 'bitbucket' | 'confluence' | 'connected-data';
|
|
70
|
+
|
|
71
|
+
declare type RequestProductMethod = (url: FetchRoute, init: RequestInit) => Promise<APIResponse>;
|
|
72
|
+
|
|
73
|
+
declare interface User {
|
|
74
|
+
accountId: string;
|
|
75
|
+
active: boolean;
|
|
76
|
+
displayName: string;
|
|
77
|
+
emailAddress?: string;
|
|
78
|
+
timeZone: string;
|
|
79
|
+
avatarUrls?: AvatarUrls;
|
|
80
|
+
accountType?: string;
|
|
81
|
+
self?: string;
|
|
82
|
+
groups?: {
|
|
83
|
+
items?: UserGroupName[];
|
|
84
|
+
size?: number;
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
declare interface UserGroupName {
|
|
89
|
+
groupId: string;
|
|
90
|
+
name: string;
|
|
91
|
+
self: string;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
declare interface UserPickerUser {
|
|
95
|
+
accountId: string;
|
|
96
|
+
accountType: string;
|
|
97
|
+
displayName: string;
|
|
98
|
+
html?: string;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export { }
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// This file is read by tools that parse documentation comments conforming to the TSDoc standard.
|
|
2
|
+
// It should be published with your NPM package. It should not be tracked by Git.
|
|
3
|
+
{
|
|
4
|
+
"tsdocVersion": "0.12",
|
|
5
|
+
"toolPackages": [
|
|
6
|
+
{
|
|
7
|
+
"packageName": "@microsoft/api-extractor",
|
|
8
|
+
"packageVersion": "7.52.8"
|
|
9
|
+
}
|
|
10
|
+
]
|
|
11
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@valiantys/atlassian-app",
|
|
3
|
-
"version": "3.2.0-alpha-
|
|
3
|
+
"version": "3.2.0-alpha-4",
|
|
4
4
|
"description": "This library provides Atlassian Forge components, wrappers, and utilities to support writing Forge apps that can run deployed or in standalone mode",
|
|
5
5
|
"exports": {
|
|
6
6
|
"./frontend-app": {
|
|
@@ -43,6 +43,11 @@
|
|
|
43
43
|
"require": "./util-resolver/index.cjs.js",
|
|
44
44
|
"types": "./util-resolver/index.d.ts"
|
|
45
45
|
},
|
|
46
|
+
"./data-access-user": {
|
|
47
|
+
"import": "./data-access-user/index.es.js",
|
|
48
|
+
"require": "./data-access-user/index.cjs.js",
|
|
49
|
+
"types": "./data-access-user/index.d.ts"
|
|
50
|
+
},
|
|
46
51
|
"./data-access-atlassian-product-fetch-oauth": {
|
|
47
52
|
"import": "./data-access-atlassian-product-fetch-oauth/index.es.js",
|
|
48
53
|
"require": "./data-access-atlassian-product-fetch-oauth/index.cjs.js",
|
|
Binary file
|
|
Binary file
|