@valiantys/atlassian-app-frontend 3.0.0-alpha-1 → 3.0.0-alpha-3

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 (29) hide show
  1. package/atlassian/forge/shared/util-product-fetch/src/lib/product-fetch/index.cjs.js +2 -2
  2. package/atlassian/forge/shared/util-product-fetch/src/lib/product-fetch/index.es.js +17 -16
  3. package/atlassian/jira/shared/data-access-issue/src/lib/jira-issue-service/index.cjs.js +1 -1
  4. package/atlassian/jira/shared/data-access-issue/src/lib/jira-issue-service/index.es.js +26 -8
  5. package/atlassian/shared/frontend-feature-oauth-login/src/lib/feature-oauth/index.cjs.js +1 -1
  6. package/atlassian/shared/frontend-feature-oauth-login/src/lib/feature-oauth/index.es.js +14 -15
  7. package/atlassian/shared/frontend-ui-iframe/src/lib/iframe-wrapper.module.scss/index.cjs.js +1 -1
  8. package/atlassian/shared/frontend-ui-iframe/src/lib/iframe-wrapper.module.scss/index.es.js +1 -1
  9. package/atlassian/shared/frontend-ui-remote-adapter/src/lib/oauth-fetch-invoke-remote/index.cjs.js +1 -1
  10. package/atlassian/shared/frontend-ui-remote-adapter/src/lib/oauth-fetch-invoke-remote/index.es.js +5 -5
  11. package/atlassian-app-frontend.css +1 -1
  12. package/data-access-issue/atlassian-app-frontend-data-access-issue.api.json +133 -0
  13. package/data-access-issue/atlassian-app-frontend.api.md +9 -0
  14. package/data-access-issue/index.d.ts +90 -31
  15. package/package.json +6 -1
  16. package/shared/util-fetch/src/lib/shared-util-fetch/index.cjs.js +2 -2
  17. package/shared/util-fetch/src/lib/shared-util-fetch/index.es.js +36 -30
  18. package/ui-iframe/atlassian-app-frontend-ui-iframe.api.json +376 -0
  19. package/ui-iframe/atlassian-app-frontend.api.md +30 -0
  20. package/ui-iframe/index.cjs.js +1 -0
  21. package/ui-iframe/index.d.ts +16 -0
  22. package/ui-iframe/index.es.js +4 -0
  23. package/ui-iframe/tsdoc-metadata.json +11 -0
  24. package/util-atlassian-product-fetch/atlassian-app-frontend-util-atlassian-product-fetch.api.json +113 -7
  25. package/util-atlassian-product-fetch/atlassian-app-frontend.api.md +10 -3
  26. package/util-atlassian-product-fetch/index.d.ts +8 -3
  27. package/util-jira-v3-api/atlassian-app-frontend-util-jira-v3-api.api.json +1020 -127
  28. package/util-jira-v3-api/atlassian-app-frontend.api.md +122 -31
  29. package/util-jira-v3-api/index.d.ts +88 -31
@@ -1,3 +1,3 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function l(e){return async({url:n,method:r,responseType:a="json",allowExperimental:f=!1},c)=>{const o={Accept:a==="json"?"application/json":"text/html"};c&&(o["Content-Type"]="application/json"),f&&(o["X-ExperimentalApi"]="opt-in");const i=JSON.stringify(c),t=await e(n,{method:r,headers:o,body:i});if(t.ok)return r==="DELETE"||t.status===204?void 0:a==="text"?s(t):y(t);{const u=`${r} ${n.value} - ${t.status} ${t.statusText}
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("../../../../../../../shared/util-fetch/src/lib/shared-util-fetch/index.cjs.js");function y(e){return async({url:n,method:r,responseType:a="json",allowExperimental:f=!1},c)=>{const s={Accept:a==="json"?"application/json":"text/html"};c&&(s["Content-Type"]="application/json"),f&&(s["X-ExperimentalApi"]="opt-in");const i=JSON.stringify(c),t=await e(n,{method:r,headers:s,body:i});if(t.ok)return r==="DELETE"||t.status===204?void 0:a==="text"?o(t):p(t);{const u=`${r} ${n.value} - ${t.status} ${t.statusText}
2
2
  Request Body: ${i}
3
- Response Body: ${await s(t)}`;throw console.error(u),new Error(u)}}}async function s(e){try{return await e.text()}catch{return""}}async function y(e){try{return await e.json()}catch{return s(e)}}exports.makeProductFetchFn=l;
3
+ Response Body: ${await o(t)}`;throw console.error(u),new l.FetchError(t.statusText,t.status,u)}}}async function o(e){try{return await e.text()}catch{return""}}async function p(e){try{return await e.json()}catch{return o(e)}}exports.makeProductFetchFn=y;
@@ -1,38 +1,39 @@
1
- function p(n) {
2
- return async ({ url: e, method: r, responseType: a = "json", allowExperimental: f = !1 }, i) => {
3
- const s = {
1
+ import { FetchError as p } from "../../../../../../../shared/util-fetch/src/lib/shared-util-fetch/index.es.js";
2
+ function x(e) {
3
+ return async ({ url: n, method: s, responseType: a = "json", allowExperimental: f = !1 }, i) => {
4
+ const r = {
4
5
  Accept: a === "json" ? "application/json" : "text/html"
5
6
  };
6
- i && (s["Content-Type"] = "application/json"), f && (s["X-ExperimentalApi"] = "opt-in");
7
- const c = JSON.stringify(i), t = await n(e, {
8
- method: r,
9
- headers: s,
7
+ i && (r["Content-Type"] = "application/json"), f && (r["X-ExperimentalApi"] = "opt-in");
8
+ const c = JSON.stringify(i), t = await e(n, {
9
+ method: s,
10
+ headers: r,
10
11
  body: c
11
12
  });
12
13
  if (t.ok)
13
- return r === "DELETE" || t.status === 204 ? void 0 : a === "text" ? o(t) : l(t);
14
+ return s === "DELETE" || t.status === 204 ? void 0 : a === "text" ? o(t) : l(t);
14
15
  {
15
- const u = `${r} ${e.value} - ${t.status} ${t.statusText}
16
+ const u = `${s} ${n.value} - ${t.status} ${t.statusText}
16
17
  Request Body: ${c}
17
18
  Response Body: ${await o(t)}`;
18
- throw console.error(u), new Error(u);
19
+ throw console.error(u), new p(t.statusText, t.status, u);
19
20
  }
20
21
  };
21
22
  }
22
- async function o(n) {
23
+ async function o(e) {
23
24
  try {
24
- return await n.text();
25
+ return await e.text();
25
26
  } catch {
26
27
  return "";
27
28
  }
28
29
  }
29
- async function l(n) {
30
+ async function l(e) {
30
31
  try {
31
- return await n.json();
32
+ return await e.json();
32
33
  } catch {
33
- return o(n);
34
+ return o(e);
34
35
  }
35
36
  }
36
37
  export {
37
- p as makeProductFetchFn
38
+ x as makeProductFetchFn
38
39
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=class r{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 i;const u=[];do{const h=await this.fetchSvc.fetch({method:"GET",url:this.fetchSvc.route`/rest/api/3/search/jql?jql=${e}&fields=${s.join(",")}&maxResults=${t}&${i?"nextPageToken="+i:""}`});u.push(...h.issues),i=h.nextPageToken}while(i!==void 0);return u}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)}};r.issueUrl="/rest/api/3/issue";let c=r;exports.JiraIssueService=c;
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)}};h.issueUrl="/rest/api/3/issue";let i=h;exports.JiraIssueService=i;
@@ -1,4 +1,4 @@
1
- const c = class c {
1
+ const i = class i {
2
2
  constructor(e) {
3
3
  this.fetchSvc = e;
4
4
  }
@@ -31,15 +31,15 @@ const c = class c {
31
31
  });
32
32
  }
33
33
  async issueSearch(e, s, t = 50) {
34
- let i;
34
+ let c;
35
35
  const h = [];
36
36
  do {
37
37
  const u = await this.fetchSvc.fetch({
38
38
  method: "GET",
39
- url: this.fetchSvc.route`/rest/api/3/search/jql?jql=${e}&fields=${s.join(",")}&maxResults=${t}&${i ? "nextPageToken=" + i : ""}`
39
+ url: this.fetchSvc.route`/rest/api/3/search/jql?jql=${e}&fields=${s.join(",")}&maxResults=${t}&${c ? "nextPageToken=" + c : ""}`
40
40
  });
41
- h.push(...u.issues), i = u.nextPageToken;
42
- } while (i !== void 0);
41
+ h.push(...u.issues), c = u.nextPageToken;
42
+ } while (c !== void 0);
43
43
  return h;
44
44
  }
45
45
  async addWorklog(e, s) {
@@ -55,9 +55,27 @@ const c = class c {
55
55
  const s = `project IN (${e.join(",")})`;
56
56
  return this.issueSearch(s, ["key"], 5e3);
57
57
  }
58
+ async createIssue(e) {
59
+ return this.fetchSvc.fetch(
60
+ {
61
+ method: "POST",
62
+ url: this.fetchSvc.route`/rest/api/2/issue`
63
+ },
64
+ e
65
+ );
66
+ }
67
+ async updateIssue(e, s) {
68
+ return this.fetchSvc.fetch(
69
+ {
70
+ method: "PUT",
71
+ url: this.fetchSvc.route`/rest/api/2/issue/${e}`
72
+ },
73
+ s
74
+ );
75
+ }
58
76
  };
59
- c.issueUrl = "/rest/api/3/issue";
60
- let a = c;
77
+ i.issueUrl = "/rest/api/3/issue";
78
+ let r = i;
61
79
  export {
62
- a as JiraIssueService
80
+ r as JiraIssueService
63
81
  };
@@ -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}){console.log("OAuthProvider");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 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,21 +1,20 @@
1
1
  import { jsx as t, jsxs as k } from "react/jsx-runtime";
2
2
  import { Flex as w, xcss as S } from "@atlaskit/primitives";
3
- import { useState as p, createContext as g, useContext as I } from "react";
4
- import { BrowserRouter as N, Routes as v, Route as l, Navigate as f } from "react-router-dom";
5
- import { OAuthCallback as O } from "../ui-oauth-callback/index.es.js";
6
- import { OAuthRedirectLogin as $ } from "../ui-oauth-redirect-login/index.es.js";
3
+ import { useState as p, createContext as I, useContext as N } from "react";
4
+ import { BrowserRouter as g, Routes as f, Route as l, Navigate as v } from "react-router-dom";
5
+ import { OAuthCallback as $ } from "../ui-oauth-callback/index.es.js";
6
+ import { OAuthRedirectLogin as O } from "../ui-oauth-redirect-login/index.es.js";
7
7
  import { redirectLogin as T } from "../util/index.es.js";
8
8
  const C = S({
9
9
  paddingBlockStart: "space.1000"
10
- }), m = g(null), y = () => {
11
- const o = I(m);
10
+ }), m = I(null), L = () => {
11
+ const o = N(m);
12
12
  return o || (console.warn("No OAuth provider"), { getAuthToken: () => "" });
13
13
  };
14
- function L({
14
+ function P({
15
15
  children: o,
16
16
  ...e
17
17
  }) {
18
- console.log("OAuthProvider");
19
18
  const [a, d] = p(
20
19
  localStorage.getItem(`${e.appName}-auth-token`)
21
20
  ), c = localStorage.getItem(
@@ -32,13 +31,13 @@ function L({
32
31
  n.expiresAt.toString()
33
32
  ), localStorage.removeItem(`${e.appName}-user-resource-id`), localStorage.removeItem(`${e.appName}-user-workspace-id`), window.location.href = i;
34
33
  }
35
- return !a || !r || u(r) ? /* @__PURE__ */ t(w, { justifyContent: "center", xcss: C, children: /* @__PURE__ */ t(N, { children: /* @__PURE__ */ k(v, { children: [
34
+ return !a || !r || u(r) ? /* @__PURE__ */ t(w, { justifyContent: "center", xcss: C, children: /* @__PURE__ */ t(g, { children: /* @__PURE__ */ k(f, { children: [
36
35
  /* @__PURE__ */ t(
37
36
  l,
38
37
  {
39
38
  path: "/",
40
39
  element: /* @__PURE__ */ t(
41
- $,
40
+ O,
42
41
  {
43
42
  clientId: e.clientId,
44
43
  redirectUri: s,
@@ -52,7 +51,7 @@ function L({
52
51
  {
53
52
  path: "/callback",
54
53
  element: /* @__PURE__ */ t(
55
- O,
54
+ $,
56
55
  {
57
56
  setAuth: A,
58
57
  redirectUri: s,
@@ -61,14 +60,14 @@ function L({
61
60
  )
62
61
  }
63
62
  ),
64
- /* @__PURE__ */ t(l, { path: "/*", element: /* @__PURE__ */ t(f, { to: "/", replace: !0 }) })
63
+ /* @__PURE__ */ t(l, { path: "/*", element: /* @__PURE__ */ t(v, { to: "/", replace: !0 }) })
65
64
  ] }) }) }) : /* @__PURE__ */ t(m.Provider, { value: { getAuthToken: x }, children: o });
66
65
  }
67
66
  function u(o) {
68
67
  return o < Date.now();
69
68
  }
70
69
  export {
71
- L as OAuthProvider,
72
- L as default,
73
- y as useOAuth
70
+ P as OAuthProvider,
71
+ P as default,
72
+ L as useOAuth
74
73
  };
@@ -1 +1 @@
1
- "use strict";const r={"iframe-wrapper":"_iframe-wrapper_1b9nc_1"};module.exports=r;
1
+ "use strict";const r={"iframe-wrapper":"_iframe-wrapper_c8hdk_1"};module.exports=r;
@@ -1,5 +1,5 @@
1
1
  const e = {
2
- "iframe-wrapper": "_iframe-wrapper_1b9nc_1"
2
+ "iframe-wrapper": "_iframe-wrapper_c8hdk_1"
3
3
  };
4
4
  export {
5
5
  e as default
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("../../../../../../shared/util-fetch/src/lib/shared-util-fetch/index.cjs.js");function n(r,t){return console.log("oauthFetchInvokeRemote"),async e=>{const a=`${r}${e.path}`,o=await fetch(a,{method:e.method,headers:t?c.addAuthHeader(t,e.headers||{}):e.headers,body:e.body?JSON.stringify(e.body):void 0}),s={};return o.headers.forEach((d,h)=>{s[h]=d}),{body:await o.json(),headers:s,status:o.status}}}exports.oauthFetchInvokeRemote=n;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("../../../../../../shared/util-fetch/src/lib/shared-util-fetch/index.cjs.js");function n(r,s){return async e=>{const a=`${r}${e.path}`,o=await fetch(a,{method:e.method,headers:s?c.addAuthHeader(s,e.headers||{}):e.headers,body:e.body?JSON.stringify(e.body):void 0}),t={};return o.headers.forEach((d,h)=>{t[h]=d}),{body:await o.json(),headers:t,status:o.status}}}exports.oauthFetchInvokeRemote=n;
@@ -1,13 +1,13 @@
1
1
  import { addAuthHeader as n } from "../../../../../../shared/util-fetch/src/lib/shared-util-fetch/index.es.js";
2
- function f(t, s) {
3
- return console.log("oauthFetchInvokeRemote"), async (e) => {
4
- const a = `${t}${e.path}`, o = await fetch(a, {
2
+ function f(d, s) {
3
+ return async (e) => {
4
+ const t = `${d}${e.path}`, o = await fetch(t, {
5
5
  method: e.method,
6
6
  headers: s ? n(s, e.headers || {}) : e.headers,
7
7
  body: e.body ? JSON.stringify(e.body) : void 0
8
8
  }), r = {};
9
- return o.headers.forEach((d, h) => {
10
- r[h] = d;
9
+ return o.headers.forEach((a, h) => {
10
+ r[h] = a;
11
11
  }), {
12
12
  body: await o.json(),
13
13
  headers: r,
@@ -1 +1 @@
1
- ._iframe-wrapper_1b9nc_1{display:flex;flex-direction:column;align-items:center;justify-content:flex-start;width:100%;height:100%;overflow:hidden;position:relative}._iframe-wrapper_1b9nc_1 iframe{border:none;width:100%;min-height:300px;margin:0;padding:0}._drop-target-box_154h8_1{width:100%;height:100%;min-height:150px}
1
+ ._iframe-wrapper_c8hdk_1{display:flex;align-items:flex-start;justify-content:center;width:100%;height:100%}._iframe-wrapper_c8hdk_1 iframe{border:none}._drop-target-box_154h8_1{width:100%;height:100%;min-height:150px}
@@ -304,6 +304,69 @@
304
304
  "isAbstract": false,
305
305
  "name": "addWorklog"
306
306
  },
307
+ {
308
+ "kind": "Method",
309
+ "canonicalReference": "@valiantys/atlassian-app-frontend!JiraIssueService#createIssue:member(1)",
310
+ "docComment": "",
311
+ "excerptTokens": [
312
+ {
313
+ "kind": "Content",
314
+ "text": "createIssue(body: "
315
+ },
316
+ {
317
+ "kind": "Reference",
318
+ "text": "CreateIssue",
319
+ "canonicalReference": "@valiantys/atlassian-app-frontend!~CreateIssue:interface"
320
+ },
321
+ {
322
+ "kind": "Content",
323
+ "text": "): "
324
+ },
325
+ {
326
+ "kind": "Reference",
327
+ "text": "Promise",
328
+ "canonicalReference": "!Promise:interface"
329
+ },
330
+ {
331
+ "kind": "Content",
332
+ "text": "<"
333
+ },
334
+ {
335
+ "kind": "Reference",
336
+ "text": "CreatedIssue",
337
+ "canonicalReference": "@valiantys/atlassian-app-frontend!~CreatedIssue:interface"
338
+ },
339
+ {
340
+ "kind": "Content",
341
+ "text": ">"
342
+ },
343
+ {
344
+ "kind": "Content",
345
+ "text": ";"
346
+ }
347
+ ],
348
+ "isStatic": false,
349
+ "returnTypeTokenRange": {
350
+ "startIndex": 3,
351
+ "endIndex": 7
352
+ },
353
+ "releaseTag": "Public",
354
+ "isProtected": false,
355
+ "overloadIndex": 1,
356
+ "parameters": [
357
+ {
358
+ "parameterName": "body",
359
+ "parameterTypeTokenRange": {
360
+ "startIndex": 1,
361
+ "endIndex": 2
362
+ },
363
+ "isOptional": false
364
+ }
365
+ ],
366
+ "isOptional": false,
367
+ "isAbstract": false,
368
+ "name": "createIssue"
369
+ },
307
370
  {
308
371
  "kind": "Method",
309
372
  "canonicalReference": "@valiantys/atlassian-app-frontend!JiraIssueService#getIssue:member(1)",
@@ -890,6 +953,76 @@
890
953
  "isOptional": false,
891
954
  "isAbstract": false,
892
955
  "name": "updateFields"
956
+ },
957
+ {
958
+ "kind": "Method",
959
+ "canonicalReference": "@valiantys/atlassian-app-frontend!JiraIssueService#updateIssue:member(1)",
960
+ "docComment": "",
961
+ "excerptTokens": [
962
+ {
963
+ "kind": "Content",
964
+ "text": "updateIssue(issueIdOrKey: "
965
+ },
966
+ {
967
+ "kind": "Content",
968
+ "text": "string"
969
+ },
970
+ {
971
+ "kind": "Content",
972
+ "text": ", body: "
973
+ },
974
+ {
975
+ "kind": "Reference",
976
+ "text": "UpdateIssue",
977
+ "canonicalReference": "@valiantys/atlassian-app-frontend!~UpdateIssue:type"
978
+ },
979
+ {
980
+ "kind": "Content",
981
+ "text": "): "
982
+ },
983
+ {
984
+ "kind": "Reference",
985
+ "text": "Promise",
986
+ "canonicalReference": "!Promise:interface"
987
+ },
988
+ {
989
+ "kind": "Content",
990
+ "text": "<void>"
991
+ },
992
+ {
993
+ "kind": "Content",
994
+ "text": ";"
995
+ }
996
+ ],
997
+ "isStatic": false,
998
+ "returnTypeTokenRange": {
999
+ "startIndex": 5,
1000
+ "endIndex": 7
1001
+ },
1002
+ "releaseTag": "Public",
1003
+ "isProtected": false,
1004
+ "overloadIndex": 1,
1005
+ "parameters": [
1006
+ {
1007
+ "parameterName": "issueIdOrKey",
1008
+ "parameterTypeTokenRange": {
1009
+ "startIndex": 1,
1010
+ "endIndex": 2
1011
+ },
1012
+ "isOptional": false
1013
+ },
1014
+ {
1015
+ "parameterName": "body",
1016
+ "parameterTypeTokenRange": {
1017
+ "startIndex": 3,
1018
+ "endIndex": 4
1019
+ },
1020
+ "isOptional": false
1021
+ }
1022
+ ],
1023
+ "isOptional": false,
1024
+ "isAbstract": false,
1025
+ "name": "updateIssue"
893
1026
  }
894
1027
  ],
895
1028
  "implementsTokenRanges": []
@@ -13,6 +13,11 @@ export class JiraIssueService {
13
13
  //
14
14
  // (undocumented)
15
15
  addWorklog(issueIdOrKey: string, worklog: WorklogCreateRequest): Promise<Worklog>;
16
+ // Warning: (ae-forgotten-export) The symbol "CreateIssue" needs to be exported by the entry point data-access-issue.d.ts
17
+ // Warning: (ae-forgotten-export) The symbol "CreatedIssue" needs to be exported by the entry point data-access-issue.d.ts
18
+ //
19
+ // (undocumented)
20
+ createIssue(body: CreateIssue): Promise<CreatedIssue>;
16
21
  // Warning: (ae-forgotten-export) The symbol "Issue" needs to be exported by the entry point data-access-issue.d.ts
17
22
  //
18
23
  // (undocumented)
@@ -33,6 +38,10 @@ export class JiraIssueService {
33
38
  updateField(issueIdOrKey: string, fieldName: string, value: unknown): Promise<void>;
34
39
  // (undocumented)
35
40
  updateFields(issueIdOrKey: string, fields: Record<string, unknown>): Promise<void>;
41
+ // Warning: (ae-forgotten-export) The symbol "UpdateIssue" needs to be exported by the entry point data-access-issue.d.ts
42
+ //
43
+ // (undocumented)
44
+ updateIssue(issueIdOrKey: string, body: UpdateIssue): Promise<void>;
36
45
  }
37
46
 
38
47
  // (No @packageDocumentation comment for this package)
@@ -15,6 +15,33 @@ declare interface AvatarUrls {
15
15
  '32x32': string;
16
16
  }
17
17
 
18
+ declare interface CreatedIssue {
19
+ id: string;
20
+ key: string;
21
+ self: string;
22
+ transition: {
23
+ status: number;
24
+ errorCollection?: {
25
+ errorMessages: string[];
26
+ errors: unknown;
27
+ };
28
+ warningCollection?: {
29
+ warnings: string[];
30
+ };
31
+ };
32
+ }
33
+
34
+ declare interface CreateIssue {
35
+ fields: IssueFields;
36
+ properties?: {
37
+ key: string;
38
+ value: unknown;
39
+ }[];
40
+ transition?: IssueTransition;
41
+ update?: Record<string, Record<string, unknown>[]>;
42
+ historyMetadata?: HistoryMetadata;
43
+ }
44
+
18
45
  declare type CustomFields = Record<string, unknown>;
19
46
 
20
47
  declare interface EntityProperty {
@@ -46,6 +73,29 @@ declare type FixVersions = {
46
73
  self: string;
47
74
  }[];
48
75
 
76
+ declare interface HistoryMetadata {
77
+ activityDescription?: string;
78
+ activityDescriptionKey?: string;
79
+ actor?: HistoryMetadataParticipant;
80
+ cause?: HistoryMetadataParticipant;
81
+ description?: string;
82
+ descriptionKey?: string;
83
+ emailDescription?: string;
84
+ emailDescriptionKey?: string;
85
+ extraData?: unknown;
86
+ generator?: HistoryMetadataParticipant;
87
+ type?: string;
88
+ }
89
+
90
+ declare interface HistoryMetadataParticipant {
91
+ avatarUrl: string;
92
+ displayName: string;
93
+ displayNameKey: string;
94
+ id: string;
95
+ type: string;
96
+ url: string;
97
+ }
98
+
49
99
  declare interface Issue {
50
100
  id: string;
51
101
  expand?: string;
@@ -77,6 +127,11 @@ declare interface IssueStatus {
77
127
  };
78
128
  }
79
129
 
130
+ declare interface IssueTransition {
131
+ id: string;
132
+ looped: boolean;
133
+ }
134
+
80
135
  export declare class JiraIssueService {
81
136
  private fetchSvc;
82
137
  static readonly issueUrl = "/rest/api/3/issue";
@@ -89,64 +144,66 @@ export declare class JiraIssueService {
89
144
  issueSearch(jql: string, fields: string[], maxResults?: number): Promise<Issue[]>;
90
145
  addWorklog(issueIdOrKey: string, worklog: WorklogCreateRequest): Promise<Worklog>;
91
146
  queryForIssuesInProjects(projectIds: number[]): Promise<Issue[]>;
147
+ createIssue(body: CreateIssue): Promise<CreatedIssue>;
148
+ updateIssue(issueIdOrKey: string, body: UpdateIssue): Promise<void>;
92
149
  }
93
150
 
94
151
  declare type Product = 'jira' | 'bitbucket' | 'confluence' | 'connected-data';
95
152
 
96
153
  declare interface Project {
97
- self: string;
154
+ self?: string;
98
155
  id: string;
99
- key: string;
100
- name: string;
101
- projectTypeKey: string;
102
- simplified: boolean;
103
- avatarUrls: AvatarUrls;
104
- archived: boolean;
156
+ key?: string;
157
+ name?: string;
158
+ projectTypeKey?: string;
159
+ simplified?: boolean;
160
+ avatarUrls?: AvatarUrls;
161
+ archived?: boolean;
105
162
  }
106
163
 
107
164
  declare type RequestProductMethod = (url: FetchRoute, init: RequestInit) => Promise<APIResponse>;
108
165
 
109
166
  declare interface StaticIssueFields {
110
- statuscategorychangedate: string;
111
- fixVersions: FixVersions;
112
- resolution: unknown;
113
- worklog: {
167
+ statuscategorychangedate?: string;
168
+ fixVersions?: FixVersions;
169
+ resolution?: unknown;
170
+ worklog?: {
114
171
  total: number;
115
172
  startAt: number;
116
173
  maxResults: number;
117
174
  worklogs: Worklog[];
118
175
  };
119
176
  issuetype: {
120
- self: string;
177
+ self?: string;
121
178
  id: string;
122
- description: string;
123
- iconUrl: string;
124
- name: string;
125
- subtask: boolean;
126
- avatarId: number;
127
- hierarchyLevel: number;
179
+ description?: string;
180
+ iconUrl?: string;
181
+ name?: string;
182
+ subtask?: boolean;
183
+ avatarId?: number;
184
+ hierarchyLevel?: number;
128
185
  };
129
- timespent: number;
186
+ timespent?: number;
130
187
  project: Project;
131
- aggregatetimespent: number;
188
+ aggregatetimespent?: number;
132
189
  resolutiondate?: string;
133
- lastViewed: string;
134
- priority: {
190
+ lastViewed?: string;
191
+ priority?: {
135
192
  self: string;
136
193
  iconUrl: string;
137
194
  name: string;
138
195
  id: string;
139
196
  };
140
- labels: string[];
141
- timeestimate: number;
142
- workratio: number;
143
- watches: {
197
+ labels?: string[];
198
+ timeestimate?: number;
199
+ workratio?: number;
200
+ watches?: {
144
201
  self: string;
145
202
  watchCount: number;
146
203
  isWatching: boolean;
147
204
  };
148
- created: string;
149
- updated: string;
205
+ created?: string;
206
+ updated?: string;
150
207
  description?: {
151
208
  type: 'doc';
152
209
  version: 1;
@@ -158,20 +215,22 @@ declare interface StaticIssueFields {
158
215
  }[];
159
216
  }[];
160
217
  };
161
- timetracking: {
218
+ timetracking?: {
162
219
  remainingEstimate: string;
163
220
  timeSpent: string;
164
221
  remainingEstimateSeconds: number;
165
222
  timeSpentSeconds: number;
166
223
  };
167
224
  summary: string;
168
- status: IssueStatus;
169
- creator: User;
225
+ status?: IssueStatus;
226
+ creator?: User;
170
227
  assignee?: User;
171
228
  reporter?: User;
172
229
  issuelinks?: IssueLink[];
173
230
  }
174
231
 
232
+ declare type UpdateIssue = CreatedIssue;
233
+
175
234
  declare interface User {
176
235
  accountId: string;
177
236
  active: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@valiantys/atlassian-app-frontend",
3
- "version": "3.0.0-alpha-1",
3
+ "version": "3.0.0-alpha-3",
4
4
  "description": "This library provides an Atlassian Forge Custom UI wrapper component that handles all the setup necessary to support an app that can run deployed or in standalone mode",
5
5
  "exports": {
6
6
  "./atlassian-app": {
@@ -83,6 +83,11 @@
83
83
  "require": "./ui-host-router/index.cjs.js",
84
84
  "types": "./ui-host-router/index.d.ts"
85
85
  },
86
+ "./ui-iframe": {
87
+ "import": "./ui-iframe/index.es.js",
88
+ "require": "./ui-iframe/index.cjs.js",
89
+ "types": "./ui-iframe/index.d.ts"
90
+ },
86
91
  "./ui-modal": {
87
92
  "import": "./ui-modal/index.es.js",
88
93
  "require": "./ui-modal/index.cjs.js",
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});class u{constructor(t){this.message=t}}function c(e,t){const r={Authorization:e.startsWith("Bearer ")?e:`Bearer ${e}`};return t?{...t,...r}:r}async function l(e,t,r){const o=c(e,r.headers||{});return fetch(t,{...r,headers:o})}async function j(e,t,r,o,s="json",a={}){return f(t,r,c(e,a),o,s)}async function f(e,t,r,o,s="json"){const a={...r||{},Accept:s==="json"?"application/json":"text/html","Content-Type":s==="json"?"application/json":"text/html"},d=o?JSON.stringify(o):void 0,n=await fetch(e,{method:t,headers:a,body:d});if(n.ok)return t==="DELETE"||n.status===204?void 0:s==="text"?await n.text():await n.json();{let i="";try{i=await n.text()}catch{}const h=`${n.status} ${n.statusText} - ${t} ${e}
2
- ${i}`;throw console.error(h),new u(h)}}exports.FetchError=u;exports.addAuthHeader=c;exports.bearerAuthFetch=j;exports.bearerAuthFetchRaw=l;exports.jsonFetch=f;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});class h extends Error{constructor(t,e,a=t){super(a),this.statusText=t,this.statusCode=e,this.statusCode=e,this.statusText=t}toJSON(){return{statusCode:this.statusCode,statusText:this.statusText}}}function c(s,t){const e={Authorization:s.startsWith("Bearer ")?s:`Bearer ${s}`};return t?{...t,...e}:e}async function l(s,t,e){const a=c(s,e.headers||{});return fetch(t,{...e,headers:a})}async function j(s,t,e,a,o="json",n={}){return d(t,e,c(s,n),a,o)}async function d(s,t,e,a,o="json"){const n={...e||{},Accept:o==="json"?"application/json":"text/html","Content-Type":o==="json"?"application/json":"text/html"},f=a?JSON.stringify(a):void 0,r=await fetch(s,{method:t,headers:n,body:f});if(r.ok)return t==="DELETE"||r.status===204?void 0:o==="text"?await r.text():await r.json();{let i="";try{i=await r.text()}catch{}const u=`${r.status} ${r.statusText} - ${t} ${s}
2
+ ${i}`;throw console.error(u),new h(r.statusText,r.status,u)}}exports.FetchError=h;exports.addAuthHeader=c;exports.bearerAuthFetch=j;exports.bearerAuthFetchRaw=l;exports.jsonFetch=d;