@valiantys/atlassian-app-frontend 3.0.0-alpha-1 → 3.0.0-alpha-2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/atlassian/forge/shared/util-product-fetch/src/lib/product-fetch/index.cjs.js +2 -2
- package/atlassian/forge/shared/util-product-fetch/src/lib/product-fetch/index.es.js +17 -16
- package/atlassian/jira/shared/data-access-issue/src/lib/jira-issue-service/index.cjs.js +1 -1
- package/atlassian/jira/shared/data-access-issue/src/lib/jira-issue-service/index.es.js +26 -8
- package/atlassian/shared/frontend-feature-oauth-login/src/lib/feature-oauth/index.cjs.js +1 -1
- package/atlassian/shared/frontend-feature-oauth-login/src/lib/feature-oauth/index.es.js +14 -15
- package/atlassian/shared/frontend-ui-iframe/src/lib/iframe-wrapper.module.scss/index.cjs.js +1 -1
- package/atlassian/shared/frontend-ui-iframe/src/lib/iframe-wrapper.module.scss/index.es.js +1 -1
- package/atlassian/shared/frontend-ui-remote-adapter/src/lib/oauth-fetch-invoke-remote/index.cjs.js +1 -1
- package/atlassian/shared/frontend-ui-remote-adapter/src/lib/oauth-fetch-invoke-remote/index.es.js +5 -5
- package/atlassian-app-frontend.css +1 -1
- package/data-access-issue/atlassian-app-frontend-data-access-issue.api.json +133 -0
- package/data-access-issue/atlassian-app-frontend.api.md +9 -0
- package/data-access-issue/index.d.ts +90 -31
- package/package.json +1 -1
- package/shared/util-fetch/src/lib/shared-util-fetch/index.cjs.js +2 -2
- package/shared/util-fetch/src/lib/shared-util-fetch/index.es.js +36 -30
- package/util-atlassian-product-fetch/atlassian-app-frontend-util-atlassian-product-fetch.api.json +113 -7
- package/util-atlassian-product-fetch/atlassian-app-frontend.api.md +10 -3
- package/util-atlassian-product-fetch/index.d.ts +8 -3
- package/util-jira-v3-api/atlassian-app-frontend-util-jira-v3-api.api.json +1020 -127
- package/util-jira-v3-api/atlassian-app-frontend.api.md +122 -31
- package/util-jira-v3-api/index.d.ts +88 -31
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});
|
|
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
|
|
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
|
-
|
|
2
|
-
|
|
3
|
-
|
|
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 && (
|
|
7
|
-
const c = JSON.stringify(i), t = await n
|
|
8
|
-
method:
|
|
9
|
-
headers:
|
|
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
|
|
14
|
+
return s === "DELETE" || t.status === 204 ? void 0 : a === "text" ? o(t) : l(t);
|
|
14
15
|
{
|
|
15
|
-
const u = `${
|
|
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
|
|
19
|
+
throw console.error(u), new p(t.statusText, t.status, u);
|
|
19
20
|
}
|
|
20
21
|
};
|
|
21
22
|
}
|
|
22
|
-
async function o(
|
|
23
|
+
async function o(e) {
|
|
23
24
|
try {
|
|
24
|
-
return await
|
|
25
|
+
return await e.text();
|
|
25
26
|
} catch {
|
|
26
27
|
return "";
|
|
27
28
|
}
|
|
28
29
|
}
|
|
29
|
-
async function l(
|
|
30
|
+
async function l(e) {
|
|
30
31
|
try {
|
|
31
|
-
return await
|
|
32
|
+
return await e.json();
|
|
32
33
|
} catch {
|
|
33
|
-
return o(
|
|
34
|
+
return o(e);
|
|
34
35
|
}
|
|
35
36
|
}
|
|
36
37
|
export {
|
|
37
|
-
|
|
38
|
+
x as makeProductFetchFn
|
|
38
39
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
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
|
|
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
|
|
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}&${
|
|
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),
|
|
42
|
-
} while (
|
|
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
|
-
|
|
60
|
-
let
|
|
77
|
+
i.issueUrl = "/rest/api/3/issue";
|
|
78
|
+
let r = i;
|
|
61
79
|
export {
|
|
62
|
-
|
|
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}){
|
|
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
|
|
4
|
-
import { BrowserRouter as
|
|
5
|
-
import { OAuthCallback as
|
|
6
|
-
import { OAuthRedirectLogin as
|
|
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 =
|
|
11
|
-
const o =
|
|
10
|
+
}), m = I(null), L = () => {
|
|
11
|
+
const o = N(m);
|
|
12
12
|
return o || (console.warn("No OAuth provider"), { getAuthToken: () => "" });
|
|
13
13
|
};
|
|
14
|
-
function
|
|
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(
|
|
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
|
-
|
|
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(
|
|
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
|
-
|
|
72
|
-
|
|
73
|
-
|
|
70
|
+
P as OAuthProvider,
|
|
71
|
+
P as default,
|
|
72
|
+
L as useOAuth
|
|
74
73
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const r={"iframe-wrapper":"_iframe-
|
|
1
|
+
"use strict";const r={"iframe-wrapper":"_iframe-wrapper_c8hdk_1"};module.exports=r;
|
package/atlassian/shared/frontend-ui-remote-adapter/src/lib/oauth-fetch-invoke-remote/index.cjs.js
CHANGED
|
@@ -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,
|
|
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;
|
package/atlassian/shared/frontend-ui-remote-adapter/src/lib/oauth-fetch-invoke-remote/index.es.js
CHANGED
|
@@ -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(
|
|
3
|
-
return
|
|
4
|
-
const
|
|
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((
|
|
10
|
-
r[h] =
|
|
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-
|
|
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
|
|
154
|
+
self?: string;
|
|
98
155
|
id: string;
|
|
99
|
-
key
|
|
100
|
-
name
|
|
101
|
-
projectTypeKey
|
|
102
|
-
simplified
|
|
103
|
-
avatarUrls
|
|
104
|
-
archived
|
|
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
|
|
111
|
-
fixVersions
|
|
112
|
-
resolution
|
|
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
|
|
177
|
+
self?: string;
|
|
121
178
|
id: string;
|
|
122
|
-
description
|
|
123
|
-
iconUrl
|
|
124
|
-
name
|
|
125
|
-
subtask
|
|
126
|
-
avatarId
|
|
127
|
-
hierarchyLevel
|
|
179
|
+
description?: string;
|
|
180
|
+
iconUrl?: string;
|
|
181
|
+
name?: string;
|
|
182
|
+
subtask?: boolean;
|
|
183
|
+
avatarId?: number;
|
|
184
|
+
hierarchyLevel?: number;
|
|
128
185
|
};
|
|
129
|
-
timespent
|
|
186
|
+
timespent?: number;
|
|
130
187
|
project: Project;
|
|
131
|
-
aggregatetimespent
|
|
188
|
+
aggregatetimespent?: number;
|
|
132
189
|
resolutiondate?: string;
|
|
133
|
-
lastViewed
|
|
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
|
|
141
|
-
timeestimate
|
|
142
|
-
workratio
|
|
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
|
|
149
|
-
updated
|
|
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
|
|
169
|
-
creator
|
|
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-
|
|
3
|
+
"version": "3.0.0-alpha-2",
|
|
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": {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});class
|
|
2
|
-
${i}`;throw console.error(
|
|
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;
|