@valiantys/atlassian-app-frontend 3.0.0-alpha-9 → 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 +45 -42
  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 +130 -11
  25. package/data-access-issue/atlassian-app-frontend.api.md +9 -7
  26. package/data-access-issue/index.d.ts +33 -17
  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 +454 -86
  42. package/util-jira-v3-api/atlassian-app-frontend.api.md +51 -23
  43. package/util-jira-v3-api/index.d.ts +37 -18
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=class u{constructor(e){this.fetchSvc=e}async updateField(e,s,t){await this.updateFields(e,{[s]:t})}async updateFields(e,s){await this.fetchSvc.fetch({method:"PUT",url:this.fetchSvc.route`/rest/api/3/issue/${e}`},{fields:s})}async getIssueField(e,s){var t;return(t=await this.getIssueFields(e,[s]))==null?void 0:t[s]}async getIssueFields(e,s){return(await this.fetchSvc.fetch({method:"GET",url:this.fetchSvc.route`/rest/api/3/issue/${e}?fields=${s.join(",")}`})).fields}async getIssue(e,s=["*all"]){return this.fetchSvc.fetch({method:"GET",url:this.fetchSvc.route`/rest/api/3/issue/${e}?fields=${s.join(",")}`})}async issueSearch(e,s,t=50){let c;const h=[];do{const r=await this.fetchSvc.fetch({method:"GET",url:this.fetchSvc.route`/rest/api/3/search/jql?jql=${e}&fields=${s.join(",")}&maxResults=${t}&${c?"nextPageToken="+c:""}`});h.push(...r.issues),c=r.nextPageToken}while(c!==void 0);return h}async addWorklog(e,s){return this.fetchSvc.fetch({method:"POST",url:this.fetchSvc.route`/rest/api/3/issue/${e}/worklog`},s)}async queryForIssuesInProjects(e){const s=`project IN (${e.join(",")})`;return this.issueSearch(s,["key"],5e3)}async createIssue(e){return this.fetchSvc.fetch({method:"POST",url:this.fetchSvc.route`/rest/api/2/issue`},e)}async updateIssue(e,s){return this.fetchSvc.fetch({method:"PUT",url:this.fetchSvc.route`/rest/api/2/issue/${e}`},s)}async getIssueComments(e,s=0){const t=s?`?startAt=${s}`:"";return await this.fetchSvc.fetch({method:"GET",url:this.fetchSvc.route`/rest/api/3/issue/${e}/comment${t}`})}async getIssueCommentById(e,s){return await this.fetchSvc.fetch({method:"GET",url:this.fetchSvc.route`/rest/api/3/issue/${e}/comment/${s}`})}async addIssueComment(e,s){return await this.fetchSvc.fetch({method:"POST",url:this.fetchSvc.route`/rest/api/3/issue/${e}/comment`},s)}async transitionIssue(e,s){return this.fetchSvc.fetch({method:"POST",url:this.fetchSvc.route`/rest/api/3/issue/${e}/transitions`},s)}async createIssueLink(e){return this.fetchSvc.fetch({method:"POST",url:this.fetchSvc.route`/rest/api/3/issueLink`},e)}};u.issueUrl="/rest/api/3/issue";let i=u;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;
@@ -2,107 +2,110 @@ const i = class i {
2
2
  constructor(e) {
3
3
  this.fetchSvc = e;
4
4
  }
5
- async updateField(e, s, t) {
6
- await this.updateFields(e, { [s]: t });
7
- }
8
- async updateFields(e, s) {
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: s }
11
+ s
15
12
  );
16
13
  }
17
- async getIssueField(e, s) {
18
- var t;
19
- return (t = await this.getIssueFields(e, [s])) == null ? void 0 : t[s];
14
+ async updateField(e, t, s) {
15
+ await this.updateFields(e, { [t]: s });
20
16
  }
21
- async getIssueFields(e, s) {
17
+ async updateFields(e, t) {
18
+ await this.updateIssue(e, { fields: t });
19
+ }
20
+ async getIssueField(e, t) {
21
+ var s;
22
+ return (s = await this.getIssueFields(e, [t])) == null ? void 0 : s[t];
23
+ }
24
+ async getIssueFields(e, t) {
22
25
  return (await this.fetchSvc.fetch({
23
26
  method: "GET",
24
- url: this.fetchSvc.route`/rest/api/3/issue/${e}?fields=${s.join(",")}`
27
+ url: this.fetchSvc.route`/rest/api/3/issue/${e}?fields=${t.join(",")}`
25
28
  })).fields;
26
29
  }
27
- async getIssue(e, s = ["*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=${s.join(",")}`
33
+ url: this.fetchSvc.route`/rest/api/3/issue/${e}?fields=${t.join(",")}&expand=${s ? "renderedFields" : ""}`
31
34
  });
32
35
  }
33
- async issueSearch(e, s, t = 50) {
36
+ async issueSearch(e, t, s = 50) {
34
37
  let c;
35
- const h = [];
38
+ const r = [];
36
39
  do {
37
- const u = await this.fetchSvc.fetch({
40
+ const h = await this.fetchSvc.fetch({
38
41
  method: "GET",
39
- url: this.fetchSvc.route`/rest/api/3/search/jql?jql=${e}&fields=${s.join(",")}&maxResults=${t}&${c ? "nextPageToken=" + c : ""}`
42
+ url: this.fetchSvc.route`/rest/api/3/search/jql?jql=${e}&fields=${t.join(",")}&maxResults=${s}&${c ? "nextPageToken=" + c : ""}`
40
43
  });
41
- h.push(...u.issues), c = u.nextPageToken;
44
+ r.push(...h.issues), c = h.nextPageToken;
42
45
  } while (c !== void 0);
43
- return h;
46
+ return r;
44
47
  }
45
- async addWorklog(e, s) {
48
+ async addWorklog(e, t) {
46
49
  return this.fetchSvc.fetch(
47
50
  {
48
51
  method: "POST",
49
52
  url: this.fetchSvc.route`/rest/api/3/issue/${e}/worklog`
50
53
  },
51
- s
54
+ t
52
55
  );
53
56
  }
54
57
  async queryForIssuesInProjects(e) {
55
- const s = `project IN (${e.join(",")})`;
56
- return this.issueSearch(s, ["key"], 5e3);
58
+ const t = `project IN (${e.join(",")})`;
59
+ return this.issueSearch(t, ["key"], 5e3);
57
60
  }
58
61
  async createIssue(e) {
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
  );
66
69
  }
67
- async updateIssue(e, s) {
70
+ async updateIssue(e, t) {
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
- s
76
+ t
74
77
  );
75
78
  }
76
- async getIssueComments(e, s = 0) {
77
- const t = s ? `?startAt=${s}` : "";
78
- return await this.fetchSvc.fetch({
79
+ async getIssueComments(e, t = 0) {
80
+ const s = t ? `?startAt=${t}` : "";
81
+ return this.fetchSvc.fetch({
79
82
  method: "GET",
80
- url: this.fetchSvc.route`/rest/api/3/issue/${e}/comment${t}`
83
+ url: this.fetchSvc.route`/rest/api/3/issue/${e}/comment${s}`
81
84
  });
82
85
  }
83
- async getIssueCommentById(e, s) {
84
- return await this.fetchSvc.fetch({
86
+ async getIssueCommentById(e, t) {
87
+ return this.fetchSvc.fetch({
85
88
  method: "GET",
86
- url: this.fetchSvc.route`/rest/api/3/issue/${e}/comment/${s}`
89
+ url: this.fetchSvc.route`/rest/api/3/issue/${e}/comment/${t}`
87
90
  });
88
91
  }
89
- async addIssueComment(e, s) {
90
- return await this.fetchSvc.fetch(
92
+ async addIssueComment(e, t) {
93
+ return this.fetchSvc.fetch(
91
94
  {
92
95
  method: "POST",
93
96
  url: this.fetchSvc.route`/rest/api/3/issue/${e}/comment`
94
97
  },
95
- s
98
+ { body: t }
96
99
  );
97
100
  }
98
101
  // https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issues/#api-rest-api-3-issue-issueidorkey-transitions-post
99
- async transitionIssue(e, s) {
102
+ async transitionIssue(e, t) {
100
103
  return this.fetchSvc.fetch(
101
104
  {
102
105
  method: "POST",
103
106
  url: this.fetchSvc.route`/rest/api/3/issue/${e}/transitions`
104
107
  },
105
- s
108
+ t
106
109
  );
107
110
  }
108
111
  async createIssueLink(e) {
@@ -116,7 +119,7 @@ const i = class i {
116
119
  }
117
120
  };
118
121
  i.issueUrl = "/rest/api/3/issue";
119
- let r = i;
122
+ let u = i;
120
123
  export {
121
- r as JiraIssueService
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;