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