@valiantys/atlassian-app-frontend 3.0.0-alpha-10 → 3.0.0-alpha-11
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-issue/src/lib/jira-issue-service/index.cjs.js +1 -1
- package/atlassian/jira/shared/data-access-issue/src/lib/jira-issue-service/index.es.js +21 -18
- package/atlassian/shared/data-access-atlassian-product-fetch-oauth/src/lib/atlassian-oauth-fetch/index.cjs.js +1 -1
- package/atlassian/shared/data-access-atlassian-product-fetch-oauth/src/lib/atlassian-oauth-fetch/index.es.js +51 -29
- package/atlassian/shared/data-access-atlassian-product-fetch-oauth/src/lib/route/index.cjs.js +1 -1
- package/atlassian/shared/data-access-atlassian-product-fetch-oauth/src/lib/route/index.es.js +28 -17
- package/atlassian/shared/frontend-feature-atlassian-app/src/lib/standalone/atlassian-app-standalone/index.cjs.js +1 -1
- package/atlassian/shared/frontend-feature-atlassian-app/src/lib/standalone/atlassian-app-standalone/index.es.js +93 -84
- package/atlassian/shared/frontend-feature-oauth-login/src/lib/feature-oauth/index.cjs.js +1 -1
- package/atlassian/shared/frontend-feature-oauth-login/src/lib/feature-oauth/index.es.js +58 -66
- package/atlassian/shared/frontend-feature-oauth-login/src/lib/oauth-routes/index.cjs.js +1 -0
- package/atlassian/shared/frontend-feature-oauth-login/src/lib/oauth-routes/index.es.js +51 -0
- package/atlassian/shared/frontend-ui-page-loading-view/src/lib/page-loading-view/index.cjs.js +1 -1
- package/atlassian/shared/frontend-ui-page-loading-view/src/lib/page-loading-view/index.es.js +1 -1
- package/atlassian-app/index.d.ts +1 -0
- package/atlassian-app-standalone/atlassian-app-frontend-atlassian-app-standalone.api.json +29 -2
- package/atlassian-app-standalone/atlassian-app-frontend.api.md +3 -1
- package/atlassian-app-standalone/index.d.ts +3 -1
- package/data-access-atlassian-product-fetch-oauth/atlassian-app-frontend-data-access-atlassian-product-fetch-oauth.api.json +241 -2
- package/data-access-atlassian-product-fetch-oauth/atlassian-app-frontend.api.md +17 -1
- package/data-access-atlassian-product-fetch-oauth/index.cjs.js +1 -1
- package/data-access-atlassian-product-fetch-oauth/index.d.ts +11 -1
- package/data-access-atlassian-product-fetch-oauth/index.es.js +9 -7
- package/data-access-issue/atlassian-app-frontend-data-access-issue.api.json +128 -9
- package/data-access-issue/atlassian-app-frontend.api.md +7 -5
- package/data-access-issue/index.d.ts +27 -11
- package/package.json +1 -1
- package/shared/util-fetch/src/lib/shared-util-fetch/index.cjs.js +2 -2
- package/shared/util-fetch/src/lib/shared-util-fetch/index.es.js +25 -24
- package/ui-oauth-login/atlassian-app-frontend-ui-oauth-login.api.json +340 -0
- package/ui-oauth-login/atlassian-app-frontend.api.md +29 -0
- package/ui-oauth-login/index.cjs.js +1 -1
- package/ui-oauth-login/index.d.ts +23 -0
- package/ui-oauth-login/index.es.js +7 -3
- package/ui-page-loading-view/atlassian-app-frontend-ui-page-loading-view.api.json +10 -5
- package/ui-page-loading-view/atlassian-app-frontend.api.md +2 -2
- package/ui-page-loading-view/index.d.ts +2 -2
- package/util-atlassian-product-fetch/atlassian-app-frontend-util-atlassian-product-fetch.api.json +97 -2
- package/util-atlassian-product-fetch/atlassian-app-frontend.api.md +9 -1
- package/util-atlassian-product-fetch/index.d.ts +6 -1
- package/util-jira-v3-api/atlassian-app-frontend-util-jira-v3-api.api.json +395 -78
- package/util-jira-v3-api/atlassian-app-frontend.api.md +47 -19
- package/util-jira-v3-api/index.d.ts +33 -14
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=class r{constructor(e){this.fetchSvc=e}async updateProperty(e,t,s){return this.fetchSvc.fetch({method:"PUT",url:this.fetchSvc.route`/rest/api/3/issue/${e}/properties/${t}`},s)}async updateField(e,t,s){await this.updateFields(e,{[t]:s})}async updateFields(e,t){await this.updateIssue(e,{fields:t})}async getIssueField(e,t){var s;return(s=await this.getIssueFields(e,[t]))==null?void 0:s[t]}async getIssueFields(e,t){return(await this.fetchSvc.fetch({method:"GET",url:this.fetchSvc.route`/rest/api/3/issue/${e}?fields=${t.join(",")}`})).fields}async getIssue(e,t=["*all"],s=!1){return this.fetchSvc.fetch({method:"GET",url:this.fetchSvc.route`/rest/api/3/issue/${e}?fields=${t.join(",")}&expand=${s?"renderedFields":""}`})}async issueSearch(e,t,s=50){let c;const h=[];do{const u=await this.fetchSvc.fetch({method:"GET",url:this.fetchSvc.route`/rest/api/3/search/jql?jql=${e}&fields=${t.join(",")}&maxResults=${s}&${c?"nextPageToken="+c:""}`});h.push(...u.issues),c=u.nextPageToken}while(c!==void 0);return h}async addWorklog(e,t){return this.fetchSvc.fetch({method:"POST",url:this.fetchSvc.route`/rest/api/3/issue/${e}/worklog`},t)}async queryForIssuesInProjects(e){const t=`project IN (${e.join(",")})`;return this.issueSearch(t,["key"],5e3)}async createIssue(e){return this.fetchSvc.fetch({method:"POST",url:this.fetchSvc.route`/rest/api/3/issue`},e)}async updateIssue(e,t){return this.fetchSvc.fetch({method:"PUT",url:this.fetchSvc.route`/rest/api/3/issue/${e}`},t)}async getIssueComments(e,t=0){const s=t?`?startAt=${t}`:"";return this.fetchSvc.fetch({method:"GET",url:this.fetchSvc.route`/rest/api/3/issue/${e}/comment${s}`})}async getIssueCommentById(e,t){return this.fetchSvc.fetch({method:"GET",url:this.fetchSvc.route`/rest/api/3/issue/${e}/comment/${t}`})}async addIssueComment(e,t){return this.fetchSvc.fetch({method:"POST",url:this.fetchSvc.route`/rest/api/3/issue/${e}/comment`},{body:t})}async transitionIssue(e,t){return this.fetchSvc.fetch({method:"POST",url:this.fetchSvc.route`/rest/api/3/issue/${e}/transitions`},t)}async createIssueLink(e){return this.fetchSvc.fetch({method:"POST",url:this.fetchSvc.route`/rest/api/3/issueLink`},e)}};r.issueUrl="/rest/api/3/issue";let i=r;exports.JiraIssueService=i;
|
|
@@ -1,19 +1,22 @@
|
|
|
1
|
-
const
|
|
1
|
+
const i = class i {
|
|
2
2
|
constructor(e) {
|
|
3
3
|
this.fetchSvc = e;
|
|
4
4
|
}
|
|
5
|
-
async
|
|
6
|
-
|
|
7
|
-
}
|
|
8
|
-
async updateFields(e, t) {
|
|
9
|
-
await this.fetchSvc.fetch(
|
|
5
|
+
async updateProperty(e, t, s) {
|
|
6
|
+
return this.fetchSvc.fetch(
|
|
10
7
|
{
|
|
11
8
|
method: "PUT",
|
|
12
|
-
url: this.fetchSvc.route`/rest/api/3/issue/${e}`
|
|
9
|
+
url: this.fetchSvc.route`/rest/api/3/issue/${e}/properties/${t}`
|
|
13
10
|
},
|
|
14
|
-
|
|
11
|
+
s
|
|
15
12
|
);
|
|
16
13
|
}
|
|
14
|
+
async updateField(e, t, s) {
|
|
15
|
+
await this.updateFields(e, { [t]: s });
|
|
16
|
+
}
|
|
17
|
+
async updateFields(e, t) {
|
|
18
|
+
await this.updateIssue(e, { fields: t });
|
|
19
|
+
}
|
|
17
20
|
async getIssueField(e, t) {
|
|
18
21
|
var s;
|
|
19
22
|
return (s = await this.getIssueFields(e, [t])) == null ? void 0 : s[t];
|
|
@@ -24,23 +27,23 @@ const h = class h {
|
|
|
24
27
|
url: this.fetchSvc.route`/rest/api/3/issue/${e}?fields=${t.join(",")}`
|
|
25
28
|
})).fields;
|
|
26
29
|
}
|
|
27
|
-
async getIssue(e, t = ["*all"]) {
|
|
30
|
+
async getIssue(e, t = ["*all"], s = !1) {
|
|
28
31
|
return this.fetchSvc.fetch({
|
|
29
32
|
method: "GET",
|
|
30
|
-
url: this.fetchSvc.route`/rest/api/3/issue/${e}?fields=${t.join(",")}`
|
|
33
|
+
url: this.fetchSvc.route`/rest/api/3/issue/${e}?fields=${t.join(",")}&expand=${s ? "renderedFields" : ""}`
|
|
31
34
|
});
|
|
32
35
|
}
|
|
33
36
|
async issueSearch(e, t, s = 50) {
|
|
34
37
|
let c;
|
|
35
|
-
const
|
|
38
|
+
const r = [];
|
|
36
39
|
do {
|
|
37
|
-
const
|
|
40
|
+
const h = await this.fetchSvc.fetch({
|
|
38
41
|
method: "GET",
|
|
39
42
|
url: this.fetchSvc.route`/rest/api/3/search/jql?jql=${e}&fields=${t.join(",")}&maxResults=${s}&${c ? "nextPageToken=" + c : ""}`
|
|
40
43
|
});
|
|
41
|
-
|
|
44
|
+
r.push(...h.issues), c = h.nextPageToken;
|
|
42
45
|
} while (c !== void 0);
|
|
43
|
-
return
|
|
46
|
+
return r;
|
|
44
47
|
}
|
|
45
48
|
async addWorklog(e, t) {
|
|
46
49
|
return this.fetchSvc.fetch(
|
|
@@ -59,7 +62,7 @@ const h = class h {
|
|
|
59
62
|
return this.fetchSvc.fetch(
|
|
60
63
|
{
|
|
61
64
|
method: "POST",
|
|
62
|
-
url: this.fetchSvc.route`/rest/api/
|
|
65
|
+
url: this.fetchSvc.route`/rest/api/3/issue`
|
|
63
66
|
},
|
|
64
67
|
e
|
|
65
68
|
);
|
|
@@ -68,7 +71,7 @@ const h = class h {
|
|
|
68
71
|
return this.fetchSvc.fetch(
|
|
69
72
|
{
|
|
70
73
|
method: "PUT",
|
|
71
|
-
url: this.fetchSvc.route`/rest/api/
|
|
74
|
+
url: this.fetchSvc.route`/rest/api/3/issue/${e}`
|
|
72
75
|
},
|
|
73
76
|
t
|
|
74
77
|
);
|
|
@@ -115,8 +118,8 @@ const h = class h {
|
|
|
115
118
|
);
|
|
116
119
|
}
|
|
117
120
|
};
|
|
118
|
-
|
|
119
|
-
let u =
|
|
121
|
+
i.issueUrl = "/rest/api/3/issue";
|
|
122
|
+
let u = i;
|
|
120
123
|
export {
|
|
121
124
|
u as JiraIssueService
|
|
122
125
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("../../../../../../shared/util-fetch/src/lib/shared-util-fetch/index.cjs.js"),c=require("../route/index.cjs.js");function u(t,e){if(e){const n=t.startsWith("/")?t.slice(1):t;return`${e}/${n}`}else return t}function i(t,e,n){return{productType:n,fetch:({url:a,method:r,responseType:h="json",allowExperimental:o=!1},l)=>s.bearerAuthFetch(t,u(a.value,e),r,l,h,{"X-ExperimentalApi":o?"opt-in":""}),route:c.route,rawFetch:(a,r)=>s.bearerAuthFetchRaw(t,u(a.value,e),r),fullUrl:a=>u(a,e)}}function f(t,e){return i(t,`https://api.atlassian.com/ex/jira/${e}`,"jira")}function p(t){return{productType:"jira",fetch:(e,n)=>{const a={request:e,body:n};return s.jsonFetch(t,"POST",void 0,a,"json","include")},route:c.routeNoEscaping,rawFetch:(e,n)=>{throw new Error("Not implemented")},fullUrl:e=>t}}function A(t,e){return i(t,`https://api.atlassian.com/ex/confluence/${e}`,"confluence")}function F(t){return i(t,"https://api.bitbucket.org","bitbucket")}async function O(t){return s.bearerAuthFetch(t,"https://api.atlassian.com/me","GET")}async function b(t,e,n,a,r){return s.jsonFetch("https://auth.atlassian.com/oauth/token","POST",void 0,{grant_type:t,client_id:e,client_secret:n,code:a,redirect_uri:r})}exports.atlassianOAuthBitbucketFetch=F;exports.atlassianOAuthConfluenceFetch=A;exports.atlassianOAuthJiraFetch=f;exports.atlassianOAuthJiraFetchViaProxy=p;exports.atlassianOAuthRawFetch=i;exports.getAtlassianOAuthToken=b;exports.getAtlassianUserDetails=O;
|
|
@@ -1,64 +1,85 @@
|
|
|
1
|
-
import { bearerAuthFetchRaw as
|
|
2
|
-
import { route as
|
|
3
|
-
function
|
|
1
|
+
import { bearerAuthFetchRaw as p, bearerAuthFetch as u, jsonFetch as c } from "../../../../../../shared/util-fetch/src/lib/shared-util-fetch/index.es.js";
|
|
2
|
+
import { route as f, routeNoEscaping as A } from "../route/index.es.js";
|
|
3
|
+
function i(t, e) {
|
|
4
4
|
if (e) {
|
|
5
5
|
const n = t.startsWith("/") ? t.slice(1) : t;
|
|
6
6
|
return `${e}/${n}`;
|
|
7
7
|
} else
|
|
8
8
|
return t;
|
|
9
9
|
}
|
|
10
|
-
function
|
|
10
|
+
function s(t, e, n) {
|
|
11
11
|
return {
|
|
12
12
|
productType: n,
|
|
13
|
-
fetch: ({ url: a, method: r, responseType:
|
|
13
|
+
fetch: ({ url: a, method: r, responseType: o = "json", allowExperimental: h = !1 }, l) => u(
|
|
14
14
|
t,
|
|
15
|
-
|
|
15
|
+
i(a.value, e),
|
|
16
16
|
r,
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
l,
|
|
18
|
+
o,
|
|
19
19
|
{
|
|
20
|
-
"X-ExperimentalApi":
|
|
20
|
+
"X-ExperimentalApi": h ? "opt-in" : ""
|
|
21
21
|
}
|
|
22
22
|
),
|
|
23
|
-
route:
|
|
24
|
-
rawFetch: (a, r) =>
|
|
23
|
+
route: f,
|
|
24
|
+
rawFetch: (a, r) => p(
|
|
25
25
|
t,
|
|
26
|
-
|
|
26
|
+
i(a.value, e),
|
|
27
27
|
r
|
|
28
28
|
),
|
|
29
|
-
fullUrl: (a) =>
|
|
29
|
+
fullUrl: (a) => i(a, e)
|
|
30
30
|
};
|
|
31
31
|
}
|
|
32
|
-
function
|
|
33
|
-
return
|
|
32
|
+
function O(t, e) {
|
|
33
|
+
return s(
|
|
34
34
|
t,
|
|
35
35
|
`https://api.atlassian.com/ex/jira/${e}`,
|
|
36
36
|
"jira"
|
|
37
37
|
);
|
|
38
38
|
}
|
|
39
|
-
function b(t
|
|
40
|
-
return
|
|
39
|
+
function b(t) {
|
|
40
|
+
return {
|
|
41
|
+
productType: "jira",
|
|
42
|
+
fetch: (e, n) => c(
|
|
43
|
+
t,
|
|
44
|
+
"POST",
|
|
45
|
+
void 0,
|
|
46
|
+
{
|
|
47
|
+
request: e,
|
|
48
|
+
body: n
|
|
49
|
+
},
|
|
50
|
+
"json",
|
|
51
|
+
"include"
|
|
52
|
+
),
|
|
53
|
+
route: A,
|
|
54
|
+
rawFetch: (e, n) => {
|
|
55
|
+
throw new Error("Not implemented");
|
|
56
|
+
},
|
|
57
|
+
fullUrl: (e) => t
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
function y(t, e) {
|
|
61
|
+
return s(
|
|
41
62
|
t,
|
|
42
63
|
`https://api.atlassian.com/ex/confluence/${e}`,
|
|
43
64
|
"confluence"
|
|
44
65
|
);
|
|
45
66
|
}
|
|
46
|
-
function
|
|
47
|
-
return
|
|
67
|
+
function j(t) {
|
|
68
|
+
return s(
|
|
48
69
|
t,
|
|
49
70
|
"https://api.bitbucket.org",
|
|
50
71
|
"bitbucket"
|
|
51
72
|
);
|
|
52
73
|
}
|
|
53
|
-
async function
|
|
54
|
-
return
|
|
74
|
+
async function w(t) {
|
|
75
|
+
return u(
|
|
55
76
|
t,
|
|
56
77
|
"https://api.atlassian.com/me",
|
|
57
78
|
"GET"
|
|
58
79
|
);
|
|
59
80
|
}
|
|
60
|
-
async function
|
|
61
|
-
return
|
|
81
|
+
async function x(t, e, n, a, r) {
|
|
82
|
+
return c(
|
|
62
83
|
"https://auth.atlassian.com/oauth/token",
|
|
63
84
|
"POST",
|
|
64
85
|
void 0,
|
|
@@ -72,10 +93,11 @@ async function k(t, e, n, a, r) {
|
|
|
72
93
|
);
|
|
73
94
|
}
|
|
74
95
|
export {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
96
|
+
j as atlassianOAuthBitbucketFetch,
|
|
97
|
+
y as atlassianOAuthConfluenceFetch,
|
|
98
|
+
O as atlassianOAuthJiraFetch,
|
|
99
|
+
b as atlassianOAuthJiraFetchViaProxy,
|
|
100
|
+
s as atlassianOAuthRawFetch,
|
|
101
|
+
x as getAtlassianOAuthToken,
|
|
102
|
+
w as getAtlassianUserDetails
|
|
81
103
|
};
|
package/atlassian/shared/data-access-atlassian-product-fetch-oauth/src/lib/route/index.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});class
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});class s{constructor(n){this.value_=n}set value(n){throw new Error("modification of a Route is not allowed")}get value(){return this.value_}}function l(t){return t instanceof s}const f=["..",".%2e","%2e.","%2e%2e",".%2E","%2E.","%2E%2e"],g=["/","\\"],r=["?","#"];function u(t,n){return t.some(o=>n.includes(o))}function h(t,n){switch(n){case"path":if(l(t))return t.value;if(t=String(t),u(f,t)||u(r,t)||u(g,t))throw new Error("Disallowing path manipulation attempt. For more information see: https://go.atlassian.com/product-fetch-api-route");return t;case"query":return l(t)?encodeURIComponent(t.value):t instanceof URLSearchParams?t.toString():encodeURIComponent(t)}}function a(t,...n){let o="path",e="";for(let i=0;i<t.length;i++){const c=t[i];if(u(r,c)&&(o="query"),e+=c,i>=n.length)break;e+=h(n[i],o)}return new s(e)}function d(t,...n){let o="";for(let e=0;e<t.length;e++){const i=t[e];if(o+=i,e>=n.length)break;o+=n[e]}return new s(o)}exports.route=a;exports.routeNoEscaping=d;
|
package/atlassian/shared/data-access-atlassian-product-fetch-oauth/src/lib/route/index.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
class
|
|
1
|
+
class s {
|
|
2
2
|
constructor(t) {
|
|
3
3
|
this.value_ = t;
|
|
4
4
|
}
|
|
@@ -9,37 +9,48 @@ class l {
|
|
|
9
9
|
return this.value_;
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
|
-
function
|
|
13
|
-
return n instanceof
|
|
12
|
+
function l(n) {
|
|
13
|
+
return n instanceof s;
|
|
14
14
|
}
|
|
15
15
|
const f = ["..", ".%2e", "%2e.", "%2e%2e", ".%2E", "%2E.", "%2E%2e"], h = ["/", "\\"], r = ["?", "#"];
|
|
16
|
-
function
|
|
17
|
-
return n.some((
|
|
16
|
+
function u(n, t) {
|
|
17
|
+
return n.some((o) => t.includes(o));
|
|
18
18
|
}
|
|
19
|
-
function
|
|
19
|
+
function g(n, t) {
|
|
20
20
|
switch (t) {
|
|
21
21
|
case "path":
|
|
22
|
-
if (
|
|
22
|
+
if (l(n))
|
|
23
23
|
return n.value;
|
|
24
|
-
if (n = String(n),
|
|
24
|
+
if (n = String(n), u(f, n) || u(r, n) || u(h, n))
|
|
25
25
|
throw new Error(
|
|
26
26
|
"Disallowing path manipulation attempt. For more information see: https://go.atlassian.com/product-fetch-api-route"
|
|
27
27
|
);
|
|
28
28
|
return n;
|
|
29
29
|
case "query":
|
|
30
|
-
return
|
|
30
|
+
return l(n) ? encodeURIComponent(n.value) : n instanceof URLSearchParams ? n.toString() : encodeURIComponent(n);
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
|
-
function
|
|
34
|
-
let
|
|
35
|
-
for (let
|
|
36
|
-
const
|
|
37
|
-
if (
|
|
33
|
+
function a(n, ...t) {
|
|
34
|
+
let o = "path", e = "";
|
|
35
|
+
for (let i = 0; i < n.length; i++) {
|
|
36
|
+
const c = n[i];
|
|
37
|
+
if (u(r, c) && (o = "query"), e += c, i >= t.length)
|
|
38
38
|
break;
|
|
39
|
-
|
|
39
|
+
e += g(t[i], o);
|
|
40
40
|
}
|
|
41
|
-
return new
|
|
41
|
+
return new s(e);
|
|
42
|
+
}
|
|
43
|
+
function w(n, ...t) {
|
|
44
|
+
let o = "";
|
|
45
|
+
for (let e = 0; e < n.length; e++) {
|
|
46
|
+
const i = n[e];
|
|
47
|
+
if (o += i, e >= t.length)
|
|
48
|
+
break;
|
|
49
|
+
o += t[e];
|
|
50
|
+
}
|
|
51
|
+
return new s(o);
|
|
42
52
|
}
|
|
43
53
|
export {
|
|
44
|
-
|
|
54
|
+
a as route,
|
|
55
|
+
w as routeNoEscaping
|
|
45
56
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("react/jsx-runtime"),g=require("@atlaskit/app-provider"),o=require("react"),S=require("../../../../../data-access-atlassian-product-fetch-oauth/src/lib/atlassian-oauth-fetch/index.cjs.js"),B=require("../../../../../data-access-resources/src/lib/atlassian-user-resource-service/index.cjs.js"),O=require("../../../../../frontend-feature-chosen-workspace-check/src/lib/feature-chosen-workspace-check/index.cjs.js");require("../../../../../frontend-feature-chosen-workspace-check/src/lib/jira-workspace-provider/index.cjs.js");const P=require("../../../../../frontend-feature-oauth-login/src/lib/feature-oauth/index.cjs.js");require("../../../../../frontend-feature-oauth-login/src/lib/oauth-routes/index.cjs.js");require("@atlaskit/heading");require("@atlaskit/primitives");require("@atlaskit/section-message");require("@atlaskit/spinner");require("../../../../../frontend-ui-app-flags/src/lib/app-flags-dispatch/index.cjs.js");const W=require("../../../../../frontend-ui-app-flags/src/lib/app-flags-provider-atlaskit/index.cjs.js"),J=require("../../../../../frontend-ui-atlassian-product-fetch/src/lib/request-bitbucket/index.cjs.js"),T=require("../../../../../frontend-ui-atlassian-product-fetch/src/lib/request-confluence/index.cjs.js"),E=require("../../../../../frontend-ui-atlassian-product-fetch/src/lib/request-jira/index.cjs.js"),y=require("../../../../../frontend-ui-backend-adapter/src/lib/backend-adapter/index.cjs.js"),M=require("../../../../../frontend-ui-backend-adapter/src/lib/oauth-fetch-invoke/index.cjs.js"),H=require("../../../../../frontend-ui-host-router/src/lib/host-router/index.cjs.js");require("@atlaskit/button/new");const _=require("../../../../../frontend-ui-host-router/src/lib/host-router-provider/index.cjs.js");require("../../../../../frontend-ui-modal/src/lib/modal-content/index.cjs.js");const $=require("../../../../../frontend-ui-modal/src/lib/modal-service/index.cjs.js"),z=require("../../../../../frontend-ui-modal/src/lib/modal-service-provider/index.cjs.js"),K=require("../../../../../frontend-ui-modal/src/lib/modal-view-context/index.cjs.js"),U=require("../../../../../frontend-ui-remote-adapter/src/lib/remote-adapter/index.cjs.js"),D=require("../../../../../frontend-ui-remote-adapter/src/lib/oauth-fetch-invoke-remote/index.cjs.js"),G=require("../../../../../frontend-ui-view-context/src/lib/view-context-provider/index.cjs.js"),L=require("../../../../../frontend-ui-view-context/src/lib/mock-view-context/index.cjs.js"),Q=o.lazy(()=>Promise.resolve().then(()=>require("../../../../../frontend-feature-chosen-resource-check/src/index/index.cjs.js")));function R({initialMockViewContext:c,backendUrl:u,remoteUrl:h,doCheckWorkspace:A,appName:i,doCheckResource:l,modalOpenerConfig:d,modalContextConfig:q,oauthConfig:n,atlassianResourceId:x,children:t}){const v=r.jsx(X,{appName:i,backendUrl:u,remoteUrl:h,initialMockViewContext:c,modalOpenerConfig:d,modalContextConfig:q,doCheckWorkspace:A,doCheckResource:l,oauthConfig:n,atlassianResourceId:x,children:t});return n?r.jsx(P.OAuthProvider,{clientId:n.clientId,codeTokenExchangeUrl:n.codeTokenExchangeUrl,appName:i,oAuthScopes:n.oAuthScopes,appBaseContext:n.appBaseContext,children:v}):v}function X({initialMockViewContext:c,backendUrl:u,remoteUrl:h,doCheckWorkspace:A,appName:i,doCheckResource:l,modalOpenerConfig:d,modalContextConfig:q,atlassianResourceId:n,children:x}){const[t,v]=o.useState(n),[a,j]=o.useState(),{getAuthToken:s}=P.useOAuth(),f=o.useCallback(()=>S.atlassianOAuthJiraFetch(s(),t??""),[s,t]),C=o.useCallback(()=>S.atlassianOAuthConfluenceFetch(s(),t??""),[s,t]),F=o.useCallback(()=>S.atlassianOAuthBitbucketFetch(s()),[s]),w=o.useCallback(async p=>{if(u&&l){const I=p??localStorage.getItem(`${i}-user-resource-id`)??"",k=await new B.AtlassianUserResourceService().checkUserChosenResource(s(),I);return k.hasChosen&&(localStorage.setItem(`${i}-user-resource-id`,k.resource.id),v(k.resource.id)),k}else return{hasChosen:!0}},[u,s,i,l]);o.useEffect(()=>{const p=t??(c==null?void 0:c.cloudId)??"";if(!a||a.cloudId!==p){const I={...a||c,cloudId:p};j(I)}},[c,t,a]);const b=o.useCallback(()=>u?M.getOauthFetchInvokeImpl(u,s(),t??""):void 0,[t,s,u]);let e=x;A&&(e=r.jsx(O.FeatureChosenWorkspaceCheck,{appName:i,children:e})),d&&(e=r.jsx(z.ModalServiceProvider,{modalService:new $.WindowModalService(d.defaultUrl,d.resourceMap),children:e})),a&&(e=r.jsx(G.ViewContextProvider,{viewContext:q?new K.ModalViewContext(a,q.openerOrigin):new L.MockViewContext(a),children:e})),e=r.jsx(_.HostRouterProvider,{hostRouter:new H.WindowHostRouter,children:r.jsx(J.RequestBitbucketProvider,{requestBitbucketImplementation:F(),children:r.jsx(T.RequestConfluenceProvider,{requestConfluenceImplementation:C(),children:r.jsx(E.RequestJiraProvider,{requestJiraImplementation:f(),children:e})})})});const m=b();return m&&(e=r.jsx(y.BackendAdapterProvider,{invokeImplementation:m,children:e})),h&&(e=r.jsx(U.RemoteAdapterProvider,{invokeRemoteImplementation:D.oauthFetchInvokeRemote(h),children:e})),l&&(e=r.jsx(Q,{checkResource:w,children:e})),r.jsx(g,{children:r.jsx(W.AppFlagsProviderAtlasKit,{children:e})})}exports.AtlassianAppStandalone=R;exports.default=R;
|
|
@@ -1,141 +1,150 @@
|
|
|
1
1
|
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
3
|
-
import { useState as
|
|
4
|
-
import { atlassianOAuthJiraFetch as
|
|
5
|
-
import { AtlassianUserResourceService as
|
|
6
|
-
import { FeatureChosenWorkspaceCheck as
|
|
2
|
+
import g from "@atlaskit/app-provider";
|
|
3
|
+
import { useState as R, useCallback as d, useEffect as C, lazy as O } from "react";
|
|
4
|
+
import { atlassianOAuthJiraFetch as W, atlassianOAuthConfluenceFetch as E, atlassianOAuthBitbucketFetch as J } from "../../../../../data-access-atlassian-product-fetch-oauth/src/lib/atlassian-oauth-fetch/index.es.js";
|
|
5
|
+
import { AtlassianUserResourceService as T } from "../../../../../data-access-resources/src/lib/atlassian-user-resource-service/index.es.js";
|
|
6
|
+
import { FeatureChosenWorkspaceCheck as y } from "../../../../../frontend-feature-chosen-workspace-check/src/lib/feature-chosen-workspace-check/index.es.js";
|
|
7
7
|
import "../../../../../frontend-feature-chosen-workspace-check/src/lib/jira-workspace-provider/index.es.js";
|
|
8
|
-
import { OAuthProvider as
|
|
8
|
+
import { OAuthProvider as H, useOAuth as $ } from "../../../../../frontend-feature-oauth-login/src/lib/feature-oauth/index.es.js";
|
|
9
|
+
import "../../../../../frontend-feature-oauth-login/src/lib/oauth-routes/index.es.js";
|
|
10
|
+
import "@atlaskit/heading";
|
|
11
|
+
import "@atlaskit/primitives";
|
|
12
|
+
import "@atlaskit/section-message";
|
|
13
|
+
import "@atlaskit/spinner";
|
|
9
14
|
import "../../../../../frontend-ui-app-flags/src/lib/app-flags-dispatch/index.es.js";
|
|
10
|
-
import { AppFlagsProviderAtlasKit as
|
|
11
|
-
import { RequestBitbucketProvider as
|
|
12
|
-
import { RequestConfluenceProvider as
|
|
13
|
-
import { RequestJiraProvider as
|
|
14
|
-
import { BackendAdapterProvider as
|
|
15
|
-
import { getOauthFetchInvokeImpl as
|
|
16
|
-
import { WindowHostRouter as
|
|
15
|
+
import { AppFlagsProviderAtlasKit as b } from "../../../../../frontend-ui-app-flags/src/lib/app-flags-provider-atlaskit/index.es.js";
|
|
16
|
+
import { RequestBitbucketProvider as j } from "../../../../../frontend-ui-atlassian-product-fetch/src/lib/request-bitbucket/index.es.js";
|
|
17
|
+
import { RequestConfluenceProvider as z } from "../../../../../frontend-ui-atlassian-product-fetch/src/lib/request-confluence/index.es.js";
|
|
18
|
+
import { RequestJiraProvider as K } from "../../../../../frontend-ui-atlassian-product-fetch/src/lib/request-jira/index.es.js";
|
|
19
|
+
import { BackendAdapterProvider as M } from "../../../../../frontend-ui-backend-adapter/src/lib/backend-adapter/index.es.js";
|
|
20
|
+
import { getOauthFetchInvokeImpl as D } from "../../../../../frontend-ui-backend-adapter/src/lib/oauth-fetch-invoke/index.es.js";
|
|
21
|
+
import { WindowHostRouter as G } from "../../../../../frontend-ui-host-router/src/lib/host-router/index.es.js";
|
|
17
22
|
import "@atlaskit/button/new";
|
|
18
|
-
import { HostRouterProvider as
|
|
23
|
+
import { HostRouterProvider as L } from "../../../../../frontend-ui-host-router/src/lib/host-router-provider/index.es.js";
|
|
19
24
|
import "../../../../../frontend-ui-modal/src/lib/modal-content/index.es.js";
|
|
20
|
-
import "
|
|
21
|
-
import "
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
|
|
28
|
-
import { MockViewContext as _ } from "../../../../../frontend-ui-view-context/src/lib/mock-view-context/index.es.js";
|
|
29
|
-
const V = W(
|
|
25
|
+
import { WindowModalService as Q } from "../../../../../frontend-ui-modal/src/lib/modal-service/index.es.js";
|
|
26
|
+
import { ModalServiceProvider as U } from "../../../../../frontend-ui-modal/src/lib/modal-service-provider/index.es.js";
|
|
27
|
+
import { ModalViewContext as X } from "../../../../../frontend-ui-modal/src/lib/modal-view-context/index.es.js";
|
|
28
|
+
import { RemoteAdapterProvider as Y } from "../../../../../frontend-ui-remote-adapter/src/lib/remote-adapter/index.es.js";
|
|
29
|
+
import { oauthFetchInvokeRemote as Z } from "../../../../../frontend-ui-remote-adapter/src/lib/oauth-fetch-invoke-remote/index.es.js";
|
|
30
|
+
import { ViewContextProvider as _ } from "../../../../../frontend-ui-view-context/src/lib/view-context-provider/index.es.js";
|
|
31
|
+
import { MockViewContext as V } from "../../../../../frontend-ui-view-context/src/lib/mock-view-context/index.es.js";
|
|
32
|
+
const N = O(
|
|
30
33
|
() => import("../../../../../frontend-feature-chosen-resource-check/src/index/index.es.js")
|
|
31
34
|
);
|
|
32
|
-
function
|
|
33
|
-
initialMockViewContext:
|
|
35
|
+
function Ee({
|
|
36
|
+
initialMockViewContext: i,
|
|
34
37
|
backendUrl: c,
|
|
35
38
|
remoteUrl: l,
|
|
36
39
|
doCheckWorkspace: I,
|
|
37
|
-
appName:
|
|
38
|
-
doCheckResource:
|
|
39
|
-
modalOpenerConfig:
|
|
40
|
+
appName: s,
|
|
41
|
+
doCheckResource: p,
|
|
42
|
+
modalOpenerConfig: u,
|
|
40
43
|
modalContextConfig: a,
|
|
41
|
-
oauthConfig:
|
|
44
|
+
oauthConfig: n,
|
|
45
|
+
atlassianResourceId: A,
|
|
42
46
|
children: t
|
|
43
47
|
}) {
|
|
44
48
|
const h = /* @__PURE__ */ r(
|
|
45
|
-
|
|
49
|
+
ee,
|
|
46
50
|
{
|
|
47
|
-
appName:
|
|
51
|
+
appName: s,
|
|
48
52
|
backendUrl: c,
|
|
49
53
|
remoteUrl: l,
|
|
50
|
-
initialMockViewContext:
|
|
51
|
-
modalOpenerConfig:
|
|
54
|
+
initialMockViewContext: i,
|
|
55
|
+
modalOpenerConfig: u,
|
|
52
56
|
modalContextConfig: a,
|
|
53
57
|
doCheckWorkspace: I,
|
|
54
|
-
doCheckResource:
|
|
55
|
-
oauthConfig:
|
|
58
|
+
doCheckResource: p,
|
|
59
|
+
oauthConfig: n,
|
|
60
|
+
atlassianResourceId: A,
|
|
56
61
|
children: t
|
|
57
62
|
}
|
|
58
63
|
);
|
|
59
|
-
return
|
|
60
|
-
|
|
64
|
+
return n ? /* @__PURE__ */ r(
|
|
65
|
+
H,
|
|
61
66
|
{
|
|
62
|
-
clientId:
|
|
63
|
-
codeTokenExchangeUrl:
|
|
64
|
-
appName:
|
|
65
|
-
oAuthScopes:
|
|
67
|
+
clientId: n.clientId,
|
|
68
|
+
codeTokenExchangeUrl: n.codeTokenExchangeUrl,
|
|
69
|
+
appName: s,
|
|
70
|
+
oAuthScopes: n.oAuthScopes,
|
|
71
|
+
appBaseContext: n.appBaseContext,
|
|
66
72
|
children: h
|
|
67
73
|
}
|
|
68
74
|
) : h;
|
|
69
75
|
}
|
|
70
|
-
function
|
|
71
|
-
initialMockViewContext:
|
|
76
|
+
function ee({
|
|
77
|
+
initialMockViewContext: i,
|
|
72
78
|
backendUrl: c,
|
|
73
79
|
remoteUrl: l,
|
|
74
80
|
doCheckWorkspace: I,
|
|
75
|
-
appName:
|
|
76
|
-
doCheckResource:
|
|
77
|
-
modalOpenerConfig:
|
|
81
|
+
appName: s,
|
|
82
|
+
doCheckResource: p,
|
|
83
|
+
modalOpenerConfig: u,
|
|
78
84
|
modalContextConfig: a,
|
|
79
|
-
|
|
85
|
+
atlassianResourceId: n,
|
|
86
|
+
children: A
|
|
80
87
|
}) {
|
|
81
|
-
const [t, h] =
|
|
88
|
+
const [t, h] = R(
|
|
89
|
+
n
|
|
90
|
+
), [m, F] = R(), { getAuthToken: o } = $(), P = d(() => W(o(), t ?? ""), [o, t]), w = d(() => E(o(), t ?? ""), [o, t]), B = d(() => J(o()), [o]), q = d(
|
|
82
91
|
async (f) => {
|
|
83
|
-
if (c &&
|
|
84
|
-
const
|
|
92
|
+
if (c && p) {
|
|
93
|
+
const S = f ?? localStorage.getItem(`${s}-user-resource-id`) ?? "", v = await new T().checkUserChosenResource(
|
|
85
94
|
o(),
|
|
86
|
-
|
|
95
|
+
S
|
|
87
96
|
);
|
|
88
97
|
return v.hasChosen && (localStorage.setItem(
|
|
89
|
-
`${
|
|
98
|
+
`${s}-user-resource-id`,
|
|
90
99
|
v.resource.id
|
|
91
100
|
), h(v.resource.id)), v;
|
|
92
101
|
} else
|
|
93
102
|
return { hasChosen: !0 };
|
|
94
103
|
},
|
|
95
|
-
[c, o,
|
|
104
|
+
[c, o, s, p]
|
|
96
105
|
);
|
|
97
|
-
|
|
98
|
-
const f = t ?? (
|
|
106
|
+
C(() => {
|
|
107
|
+
const f = t ?? (i == null ? void 0 : i.cloudId) ?? "";
|
|
99
108
|
if (!m || m.cloudId !== f) {
|
|
100
|
-
const
|
|
101
|
-
...m ||
|
|
109
|
+
const S = {
|
|
110
|
+
...m || i,
|
|
102
111
|
cloudId: f
|
|
103
112
|
};
|
|
104
|
-
|
|
113
|
+
F(S);
|
|
105
114
|
}
|
|
106
|
-
}, [
|
|
107
|
-
const
|
|
108
|
-
() => c ?
|
|
115
|
+
}, [i, t, m]);
|
|
116
|
+
const x = d(
|
|
117
|
+
() => c ? D(c, o(), t ?? "") : void 0,
|
|
109
118
|
[t, o, c]
|
|
110
119
|
);
|
|
111
|
-
let e =
|
|
112
|
-
I && (e = /* @__PURE__ */ r(
|
|
113
|
-
|
|
120
|
+
let e = A;
|
|
121
|
+
I && (e = /* @__PURE__ */ r(y, { appName: s, children: e })), u && (e = /* @__PURE__ */ r(
|
|
122
|
+
U,
|
|
114
123
|
{
|
|
115
|
-
modalService: new
|
|
116
|
-
|
|
117
|
-
|
|
124
|
+
modalService: new Q(
|
|
125
|
+
u.defaultUrl,
|
|
126
|
+
u.resourceMap
|
|
118
127
|
),
|
|
119
128
|
children: e
|
|
120
129
|
}
|
|
121
130
|
)), m && (e = /* @__PURE__ */ r(
|
|
122
|
-
|
|
131
|
+
_,
|
|
123
132
|
{
|
|
124
|
-
viewContext: a ? new
|
|
133
|
+
viewContext: a ? new X(m, a.openerOrigin) : new V(m),
|
|
125
134
|
children: e
|
|
126
135
|
}
|
|
127
|
-
)), e = /* @__PURE__ */ r(
|
|
128
|
-
|
|
136
|
+
)), e = /* @__PURE__ */ r(L, { hostRouter: new G(), children: /* @__PURE__ */ r(
|
|
137
|
+
j,
|
|
129
138
|
{
|
|
130
|
-
requestBitbucketImplementation:
|
|
139
|
+
requestBitbucketImplementation: B(),
|
|
131
140
|
children: /* @__PURE__ */ r(
|
|
132
|
-
|
|
141
|
+
z,
|
|
133
142
|
{
|
|
134
|
-
requestConfluenceImplementation:
|
|
143
|
+
requestConfluenceImplementation: w(),
|
|
135
144
|
children: /* @__PURE__ */ r(
|
|
136
|
-
|
|
145
|
+
K,
|
|
137
146
|
{
|
|
138
|
-
requestJiraImplementation:
|
|
147
|
+
requestJiraImplementation: P(),
|
|
139
148
|
children: e
|
|
140
149
|
}
|
|
141
150
|
)
|
|
@@ -143,16 +152,16 @@ function N({
|
|
|
143
152
|
)
|
|
144
153
|
}
|
|
145
154
|
) });
|
|
146
|
-
const
|
|
147
|
-
return
|
|
148
|
-
|
|
155
|
+
const k = x();
|
|
156
|
+
return k && (e = /* @__PURE__ */ r(M, { invokeImplementation: k, children: e })), l && (e = /* @__PURE__ */ r(
|
|
157
|
+
Y,
|
|
149
158
|
{
|
|
150
|
-
invokeRemoteImplementation:
|
|
159
|
+
invokeRemoteImplementation: Z(l),
|
|
151
160
|
children: e
|
|
152
161
|
}
|
|
153
|
-
)),
|
|
162
|
+
)), p && (e = /* @__PURE__ */ r(N, { checkResource: q, children: e })), /* @__PURE__ */ r(g, { children: /* @__PURE__ */ r(b, { children: e }) });
|
|
154
163
|
}
|
|
155
164
|
export {
|
|
156
|
-
|
|
157
|
-
|
|
165
|
+
Ee as AtlassianAppStandalone,
|
|
166
|
+
Ee as default
|
|
158
167
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const l=require("react/jsx-runtime"),t=require("react"),w=require("../oauth-routes/index.cjs.js"),A=require("../util/index.cjs.js"),p=t.createContext(null),S=()=>{const o=t.useContext(p);return o||(console.warn("No OAuth provider"),{getAuthToken:()=>""})};function i({children:o,...e}){const s=t.useMemo(()=>localStorage.getItem(`${e.appName}-auth-token`),[e.appName]),a=t.useMemo(()=>{const r=localStorage.getItem(`${e.appName}-auth-expires-at`);return r?Number(r):null},[e.appName]),n=t.useMemo(()=>window.location.protocol+"//"+window.location.hostname+(window.location.port?`:${window.location.port}`:"")+(e.appBaseContext??""),[e.appBaseContext]),u=t.useMemo(()=>n+"/callback?location="+window.location.href,[n]),m=t.useMemo(()=>(e.appBaseContext??"")+"/callback",[e.appBaseContext]),h=t.useCallback(r=>{localStorage.setItem(`${e.appName}-auth-token`,r.token),localStorage.setItem(`${e.appName}-auth-expires-at`,r.expiresAt.toString()),localStorage.removeItem(`${e.appName}-user-resource-id`),localStorage.removeItem(`${e.appName}-user-workspace-id`);const x=new URLSearchParams(window.location.search);window.location.href=x.get("location")??n},[e.appName,n]),d=t.useMemo(()=>({getAuthToken:()=>a&&s&&!c(a)?s:(A.redirectLogin(e.clientId,u,e.oAuthScopes),"")}),[e.clientId,e.oAuthScopes,a,u,s]);return!s||!a||c(a)?l.jsx(w.OAuthRoutes,{setAuth:h,redirectUri:u,oAuthScopes:e.oAuthScopes,codeTokenExchangeUrl:e.codeTokenExchangeUrl,callbackPath:m,clientId:e.clientId}):l.jsx(p.Provider,{value:d,children:o})}function c(o){return o<Date.now()}exports.OAuthProvider=i;exports.default=i;exports.useOAuth=S;
|