@valiantys/atlassian-app-frontend 3.0.0-alpha-10 → 3.0.0-alpha-17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/atlassian/jira/shared/data-access-issue/src/lib/jira-issue-service/index.cjs.js +1 -1
- package/atlassian/jira/shared/data-access-issue/src/lib/jira-issue-service/index.es.js +36 -22
- package/atlassian/shared/data-access-atlassian-product-fetch-oauth/src/lib/atlassian-oauth-fetch/index.cjs.js +1 -1
- package/atlassian/shared/data-access-atlassian-product-fetch-oauth/src/lib/atlassian-oauth-fetch/index.es.js +74 -28
- package/atlassian/shared/data-access-atlassian-product-fetch-oauth/src/lib/route/index.cjs.js +1 -1
- package/atlassian/shared/data-access-atlassian-product-fetch-oauth/src/lib/route/index.es.js +28 -17
- package/atlassian/shared/frontend-feature-atlassian-app/src/lib/standalone/atlassian-app-standalone/index.cjs.js +1 -1
- package/atlassian/shared/frontend-feature-atlassian-app/src/lib/standalone/atlassian-app-standalone/index.es.js +93 -84
- package/atlassian/shared/frontend-feature-oauth-login/src/lib/feature-oauth/index.cjs.js +1 -1
- package/atlassian/shared/frontend-feature-oauth-login/src/lib/feature-oauth/index.es.js +58 -66
- package/atlassian/shared/frontend-feature-oauth-login/src/lib/oauth-routes/index.cjs.js +1 -0
- package/atlassian/shared/frontend-feature-oauth-login/src/lib/oauth-routes/index.es.js +51 -0
- package/atlassian/shared/frontend-ui-page-loading-view/src/lib/page-loading-view/index.cjs.js +1 -1
- package/atlassian/shared/frontend-ui-page-loading-view/src/lib/page-loading-view/index.es.js +1 -1
- package/atlassian-app/index.d.ts +1 -0
- package/atlassian-app-standalone/atlassian-app-frontend-atlassian-app-standalone.api.json +29 -2
- package/atlassian-app-standalone/atlassian-app-frontend.api.md +3 -1
- package/atlassian-app-standalone/index.d.ts +3 -1
- package/atlassian-app-test/index.d.ts +1 -1
- package/data-access-assets/index.d.ts +1 -1
- package/data-access-atlassian-product-fetch-oauth/atlassian-app-frontend-data-access-atlassian-product-fetch-oauth.api.json +354 -2
- package/data-access-atlassian-product-fetch-oauth/atlassian-app-frontend.api.md +20 -1
- package/data-access-atlassian-product-fetch-oauth/index.cjs.js +1 -1
- package/data-access-atlassian-product-fetch-oauth/index.d.ts +14 -2
- package/data-access-atlassian-product-fetch-oauth/index.es.js +10 -7
- package/data-access-issue/atlassian-app-frontend-data-access-issue.api.json +238 -9
- package/data-access-issue/atlassian-app-frontend.api.md +12 -5
- package/data-access-issue/index.d.ts +40 -17
- package/data-access-jql/index.d.ts +1 -1
- package/data-access-workspaces/index.d.ts +1 -1
- package/package.json +1 -1
- package/shared/util-fetch/src/lib/shared-util-fetch/index.cjs.js +2 -2
- package/shared/util-fetch/src/lib/shared-util-fetch/index.es.js +25 -24
- package/ui-atlassian-product-fetch/index.d.ts +1 -1
- package/ui-oauth-login/atlassian-app-frontend-ui-oauth-login.api.json +340 -0
- package/ui-oauth-login/atlassian-app-frontend.api.md +29 -0
- package/ui-oauth-login/index.cjs.js +1 -1
- package/ui-oauth-login/index.d.ts +23 -0
- package/ui-oauth-login/index.es.js +7 -3
- package/ui-page-loading-view/atlassian-app-frontend-ui-page-loading-view.api.json +10 -5
- package/ui-page-loading-view/atlassian-app-frontend.api.md +2 -2
- package/ui-page-loading-view/index.d.ts +2 -2
- package/util-atlassian-product-fetch/atlassian-app-frontend-util-atlassian-product-fetch.api.json +106 -20
- package/util-atlassian-product-fetch/atlassian-app-frontend.api.md +13 -5
- package/util-atlassian-product-fetch/index.d.ts +10 -5
- package/util-jira-v3-api/atlassian-app-frontend-util-jira-v3-api.api.json +695 -80
- package/util-jira-v3-api/atlassian-app-frontend.api.md +71 -24
- package/util-jira-v3-api/index.d.ts +46 -19
|
@@ -1,141 +1,150 @@
|
|
|
1
1
|
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
3
|
-
import { useState as
|
|
4
|
-
import { atlassianOAuthJiraFetch as
|
|
5
|
-
import { AtlassianUserResourceService as
|
|
6
|
-
import { FeatureChosenWorkspaceCheck as
|
|
2
|
+
import g from "@atlaskit/app-provider";
|
|
3
|
+
import { useState as R, useCallback as d, useEffect as C, lazy as O } from "react";
|
|
4
|
+
import { atlassianOAuthJiraFetch as W, atlassianOAuthConfluenceFetch as E, atlassianOAuthBitbucketFetch as J } from "../../../../../data-access-atlassian-product-fetch-oauth/src/lib/atlassian-oauth-fetch/index.es.js";
|
|
5
|
+
import { AtlassianUserResourceService as T } from "../../../../../data-access-resources/src/lib/atlassian-user-resource-service/index.es.js";
|
|
6
|
+
import { FeatureChosenWorkspaceCheck as y } from "../../../../../frontend-feature-chosen-workspace-check/src/lib/feature-chosen-workspace-check/index.es.js";
|
|
7
7
|
import "../../../../../frontend-feature-chosen-workspace-check/src/lib/jira-workspace-provider/index.es.js";
|
|
8
|
-
import { OAuthProvider as
|
|
8
|
+
import { OAuthProvider as H, useOAuth as $ } from "../../../../../frontend-feature-oauth-login/src/lib/feature-oauth/index.es.js";
|
|
9
|
+
import "../../../../../frontend-feature-oauth-login/src/lib/oauth-routes/index.es.js";
|
|
10
|
+
import "@atlaskit/heading";
|
|
11
|
+
import "@atlaskit/primitives";
|
|
12
|
+
import "@atlaskit/section-message";
|
|
13
|
+
import "@atlaskit/spinner";
|
|
9
14
|
import "../../../../../frontend-ui-app-flags/src/lib/app-flags-dispatch/index.es.js";
|
|
10
|
-
import { AppFlagsProviderAtlasKit as
|
|
11
|
-
import { RequestBitbucketProvider as
|
|
12
|
-
import { RequestConfluenceProvider as
|
|
13
|
-
import { RequestJiraProvider as
|
|
14
|
-
import { BackendAdapterProvider as
|
|
15
|
-
import { getOauthFetchInvokeImpl as
|
|
16
|
-
import { WindowHostRouter as
|
|
15
|
+
import { AppFlagsProviderAtlasKit as b } from "../../../../../frontend-ui-app-flags/src/lib/app-flags-provider-atlaskit/index.es.js";
|
|
16
|
+
import { RequestBitbucketProvider as j } from "../../../../../frontend-ui-atlassian-product-fetch/src/lib/request-bitbucket/index.es.js";
|
|
17
|
+
import { RequestConfluenceProvider as z } from "../../../../../frontend-ui-atlassian-product-fetch/src/lib/request-confluence/index.es.js";
|
|
18
|
+
import { RequestJiraProvider as K } from "../../../../../frontend-ui-atlassian-product-fetch/src/lib/request-jira/index.es.js";
|
|
19
|
+
import { BackendAdapterProvider as M } from "../../../../../frontend-ui-backend-adapter/src/lib/backend-adapter/index.es.js";
|
|
20
|
+
import { getOauthFetchInvokeImpl as D } from "../../../../../frontend-ui-backend-adapter/src/lib/oauth-fetch-invoke/index.es.js";
|
|
21
|
+
import { WindowHostRouter as G } from "../../../../../frontend-ui-host-router/src/lib/host-router/index.es.js";
|
|
17
22
|
import "@atlaskit/button/new";
|
|
18
|
-
import { HostRouterProvider as
|
|
23
|
+
import { HostRouterProvider as L } from "../../../../../frontend-ui-host-router/src/lib/host-router-provider/index.es.js";
|
|
19
24
|
import "../../../../../frontend-ui-modal/src/lib/modal-content/index.es.js";
|
|
20
|
-
import "
|
|
21
|
-
import "
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
|
|
28
|
-
import { MockViewContext as _ } from "../../../../../frontend-ui-view-context/src/lib/mock-view-context/index.es.js";
|
|
29
|
-
const V = W(
|
|
25
|
+
import { WindowModalService as Q } from "../../../../../frontend-ui-modal/src/lib/modal-service/index.es.js";
|
|
26
|
+
import { ModalServiceProvider as U } from "../../../../../frontend-ui-modal/src/lib/modal-service-provider/index.es.js";
|
|
27
|
+
import { ModalViewContext as X } from "../../../../../frontend-ui-modal/src/lib/modal-view-context/index.es.js";
|
|
28
|
+
import { RemoteAdapterProvider as Y } from "../../../../../frontend-ui-remote-adapter/src/lib/remote-adapter/index.es.js";
|
|
29
|
+
import { oauthFetchInvokeRemote as Z } from "../../../../../frontend-ui-remote-adapter/src/lib/oauth-fetch-invoke-remote/index.es.js";
|
|
30
|
+
import { ViewContextProvider as _ } from "../../../../../frontend-ui-view-context/src/lib/view-context-provider/index.es.js";
|
|
31
|
+
import { MockViewContext as V } from "../../../../../frontend-ui-view-context/src/lib/mock-view-context/index.es.js";
|
|
32
|
+
const N = O(
|
|
30
33
|
() => import("../../../../../frontend-feature-chosen-resource-check/src/index/index.es.js")
|
|
31
34
|
);
|
|
32
|
-
function
|
|
33
|
-
initialMockViewContext:
|
|
35
|
+
function Ee({
|
|
36
|
+
initialMockViewContext: i,
|
|
34
37
|
backendUrl: c,
|
|
35
38
|
remoteUrl: l,
|
|
36
39
|
doCheckWorkspace: I,
|
|
37
|
-
appName:
|
|
38
|
-
doCheckResource:
|
|
39
|
-
modalOpenerConfig:
|
|
40
|
+
appName: s,
|
|
41
|
+
doCheckResource: p,
|
|
42
|
+
modalOpenerConfig: u,
|
|
40
43
|
modalContextConfig: a,
|
|
41
|
-
oauthConfig:
|
|
44
|
+
oauthConfig: n,
|
|
45
|
+
atlassianResourceId: A,
|
|
42
46
|
children: t
|
|
43
47
|
}) {
|
|
44
48
|
const h = /* @__PURE__ */ r(
|
|
45
|
-
|
|
49
|
+
ee,
|
|
46
50
|
{
|
|
47
|
-
appName:
|
|
51
|
+
appName: s,
|
|
48
52
|
backendUrl: c,
|
|
49
53
|
remoteUrl: l,
|
|
50
|
-
initialMockViewContext:
|
|
51
|
-
modalOpenerConfig:
|
|
54
|
+
initialMockViewContext: i,
|
|
55
|
+
modalOpenerConfig: u,
|
|
52
56
|
modalContextConfig: a,
|
|
53
57
|
doCheckWorkspace: I,
|
|
54
|
-
doCheckResource:
|
|
55
|
-
oauthConfig:
|
|
58
|
+
doCheckResource: p,
|
|
59
|
+
oauthConfig: n,
|
|
60
|
+
atlassianResourceId: A,
|
|
56
61
|
children: t
|
|
57
62
|
}
|
|
58
63
|
);
|
|
59
|
-
return
|
|
60
|
-
|
|
64
|
+
return n ? /* @__PURE__ */ r(
|
|
65
|
+
H,
|
|
61
66
|
{
|
|
62
|
-
clientId:
|
|
63
|
-
codeTokenExchangeUrl:
|
|
64
|
-
appName:
|
|
65
|
-
oAuthScopes:
|
|
67
|
+
clientId: n.clientId,
|
|
68
|
+
codeTokenExchangeUrl: n.codeTokenExchangeUrl,
|
|
69
|
+
appName: s,
|
|
70
|
+
oAuthScopes: n.oAuthScopes,
|
|
71
|
+
appBaseContext: n.appBaseContext,
|
|
66
72
|
children: h
|
|
67
73
|
}
|
|
68
74
|
) : h;
|
|
69
75
|
}
|
|
70
|
-
function
|
|
71
|
-
initialMockViewContext:
|
|
76
|
+
function ee({
|
|
77
|
+
initialMockViewContext: i,
|
|
72
78
|
backendUrl: c,
|
|
73
79
|
remoteUrl: l,
|
|
74
80
|
doCheckWorkspace: I,
|
|
75
|
-
appName:
|
|
76
|
-
doCheckResource:
|
|
77
|
-
modalOpenerConfig:
|
|
81
|
+
appName: s,
|
|
82
|
+
doCheckResource: p,
|
|
83
|
+
modalOpenerConfig: u,
|
|
78
84
|
modalContextConfig: a,
|
|
79
|
-
|
|
85
|
+
atlassianResourceId: n,
|
|
86
|
+
children: A
|
|
80
87
|
}) {
|
|
81
|
-
const [t, h] =
|
|
88
|
+
const [t, h] = R(
|
|
89
|
+
n
|
|
90
|
+
), [m, F] = R(), { getAuthToken: o } = $(), P = d(() => W(o(), t ?? ""), [o, t]), w = d(() => E(o(), t ?? ""), [o, t]), B = d(() => J(o()), [o]), q = d(
|
|
82
91
|
async (f) => {
|
|
83
|
-
if (c &&
|
|
84
|
-
const
|
|
92
|
+
if (c && p) {
|
|
93
|
+
const S = f ?? localStorage.getItem(`${s}-user-resource-id`) ?? "", v = await new T().checkUserChosenResource(
|
|
85
94
|
o(),
|
|
86
|
-
|
|
95
|
+
S
|
|
87
96
|
);
|
|
88
97
|
return v.hasChosen && (localStorage.setItem(
|
|
89
|
-
`${
|
|
98
|
+
`${s}-user-resource-id`,
|
|
90
99
|
v.resource.id
|
|
91
100
|
), h(v.resource.id)), v;
|
|
92
101
|
} else
|
|
93
102
|
return { hasChosen: !0 };
|
|
94
103
|
},
|
|
95
|
-
[c, o,
|
|
104
|
+
[c, o, s, p]
|
|
96
105
|
);
|
|
97
|
-
|
|
98
|
-
const f = t ?? (
|
|
106
|
+
C(() => {
|
|
107
|
+
const f = t ?? (i == null ? void 0 : i.cloudId) ?? "";
|
|
99
108
|
if (!m || m.cloudId !== f) {
|
|
100
|
-
const
|
|
101
|
-
...m ||
|
|
109
|
+
const S = {
|
|
110
|
+
...m || i,
|
|
102
111
|
cloudId: f
|
|
103
112
|
};
|
|
104
|
-
|
|
113
|
+
F(S);
|
|
105
114
|
}
|
|
106
|
-
}, [
|
|
107
|
-
const
|
|
108
|
-
() => c ?
|
|
115
|
+
}, [i, t, m]);
|
|
116
|
+
const x = d(
|
|
117
|
+
() => c ? D(c, o(), t ?? "") : void 0,
|
|
109
118
|
[t, o, c]
|
|
110
119
|
);
|
|
111
|
-
let e =
|
|
112
|
-
I && (e = /* @__PURE__ */ r(
|
|
113
|
-
|
|
120
|
+
let e = A;
|
|
121
|
+
I && (e = /* @__PURE__ */ r(y, { appName: s, children: e })), u && (e = /* @__PURE__ */ r(
|
|
122
|
+
U,
|
|
114
123
|
{
|
|
115
|
-
modalService: new
|
|
116
|
-
|
|
117
|
-
|
|
124
|
+
modalService: new Q(
|
|
125
|
+
u.defaultUrl,
|
|
126
|
+
u.resourceMap
|
|
118
127
|
),
|
|
119
128
|
children: e
|
|
120
129
|
}
|
|
121
130
|
)), m && (e = /* @__PURE__ */ r(
|
|
122
|
-
|
|
131
|
+
_,
|
|
123
132
|
{
|
|
124
|
-
viewContext: a ? new
|
|
133
|
+
viewContext: a ? new X(m, a.openerOrigin) : new V(m),
|
|
125
134
|
children: e
|
|
126
135
|
}
|
|
127
|
-
)), e = /* @__PURE__ */ r(
|
|
128
|
-
|
|
136
|
+
)), e = /* @__PURE__ */ r(L, { hostRouter: new G(), children: /* @__PURE__ */ r(
|
|
137
|
+
j,
|
|
129
138
|
{
|
|
130
|
-
requestBitbucketImplementation:
|
|
139
|
+
requestBitbucketImplementation: B(),
|
|
131
140
|
children: /* @__PURE__ */ r(
|
|
132
|
-
|
|
141
|
+
z,
|
|
133
142
|
{
|
|
134
|
-
requestConfluenceImplementation:
|
|
143
|
+
requestConfluenceImplementation: w(),
|
|
135
144
|
children: /* @__PURE__ */ r(
|
|
136
|
-
|
|
145
|
+
K,
|
|
137
146
|
{
|
|
138
|
-
requestJiraImplementation:
|
|
147
|
+
requestJiraImplementation: P(),
|
|
139
148
|
children: e
|
|
140
149
|
}
|
|
141
150
|
)
|
|
@@ -143,16 +152,16 @@ function N({
|
|
|
143
152
|
)
|
|
144
153
|
}
|
|
145
154
|
) });
|
|
146
|
-
const
|
|
147
|
-
return
|
|
148
|
-
|
|
155
|
+
const k = x();
|
|
156
|
+
return k && (e = /* @__PURE__ */ r(M, { invokeImplementation: k, children: e })), l && (e = /* @__PURE__ */ r(
|
|
157
|
+
Y,
|
|
149
158
|
{
|
|
150
|
-
invokeRemoteImplementation:
|
|
159
|
+
invokeRemoteImplementation: Z(l),
|
|
151
160
|
children: e
|
|
152
161
|
}
|
|
153
|
-
)),
|
|
162
|
+
)), p && (e = /* @__PURE__ */ r(N, { checkResource: q, children: e })), /* @__PURE__ */ r(g, { children: /* @__PURE__ */ r(b, { children: e }) });
|
|
154
163
|
}
|
|
155
164
|
export {
|
|
156
|
-
|
|
157
|
-
|
|
165
|
+
Ee as AtlassianAppStandalone,
|
|
166
|
+
Ee as default
|
|
158
167
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const l=require("react/jsx-runtime"),t=require("react"),w=require("../oauth-routes/index.cjs.js"),A=require("../util/index.cjs.js"),p=t.createContext(null),S=()=>{const o=t.useContext(p);return o||(console.warn("No OAuth provider"),{getAuthToken:()=>""})};function i({children:o,...e}){const s=t.useMemo(()=>localStorage.getItem(`${e.appName}-auth-token`),[e.appName]),a=t.useMemo(()=>{const r=localStorage.getItem(`${e.appName}-auth-expires-at`);return r?Number(r):null},[e.appName]),n=t.useMemo(()=>window.location.protocol+"//"+window.location.hostname+(window.location.port?`:${window.location.port}`:"")+(e.appBaseContext??""),[e.appBaseContext]),u=t.useMemo(()=>n+"/callback?location="+window.location.href,[n]),m=t.useMemo(()=>(e.appBaseContext??"")+"/callback",[e.appBaseContext]),h=t.useCallback(r=>{localStorage.setItem(`${e.appName}-auth-token`,r.token),localStorage.setItem(`${e.appName}-auth-expires-at`,r.expiresAt.toString()),localStorage.removeItem(`${e.appName}-user-resource-id`),localStorage.removeItem(`${e.appName}-user-workspace-id`);const x=new URLSearchParams(window.location.search);window.location.href=x.get("location")??n},[e.appName,n]),d=t.useMemo(()=>({getAuthToken:()=>a&&s&&!c(a)?s:(A.redirectLogin(e.clientId,u,e.oAuthScopes),"")}),[e.clientId,e.oAuthScopes,a,u,s]);return!s||!a||c(a)?l.jsx(w.OAuthRoutes,{setAuth:h,redirectUri:u,oAuthScopes:e.oAuthScopes,codeTokenExchangeUrl:e.codeTokenExchangeUrl,callbackPath:m,clientId:e.clientId}):l.jsx(p.Provider,{value:d,children:o})}function c(o){return o<Date.now()}exports.OAuthProvider=i;exports.default=i;exports.useOAuth=S;
|
|
@@ -1,73 +1,65 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const C = S({
|
|
9
|
-
paddingBlockStart: "space.1000"
|
|
10
|
-
}), m = I(null), L = () => {
|
|
11
|
-
const o = N(m);
|
|
12
|
-
return o || (console.warn("No OAuth provider"), { getAuthToken: () => "" });
|
|
1
|
+
import { jsx as p } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo as o, useCallback as w, createContext as x, useContext as A } from "react";
|
|
3
|
+
import { OAuthRoutes as k } from "../oauth-routes/index.es.js";
|
|
4
|
+
import { redirectLogin as S } from "../util/index.es.js";
|
|
5
|
+
const u = x(null), v = () => {
|
|
6
|
+
const t = A(u);
|
|
7
|
+
return t || (console.warn("No OAuth provider"), { getAuthToken: () => "" });
|
|
13
8
|
};
|
|
14
|
-
function
|
|
15
|
-
children:
|
|
9
|
+
function b({
|
|
10
|
+
children: t,
|
|
16
11
|
...e
|
|
17
12
|
}) {
|
|
18
|
-
const
|
|
19
|
-
localStorage.getItem(`${e.appName}-auth-token`)
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
{
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
),
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
),
|
|
63
|
-
/* @__PURE__ */ t(l, { path: "/*", element: /* @__PURE__ */ t(v, { to: "/", replace: !0 }) })
|
|
64
|
-
] }) }) }) : /* @__PURE__ */ t(m.Provider, { value: { getAuthToken: x }, children: o });
|
|
13
|
+
const n = o(
|
|
14
|
+
() => localStorage.getItem(`${e.appName}-auth-token`),
|
|
15
|
+
[e.appName]
|
|
16
|
+
), a = o(() => {
|
|
17
|
+
const r = localStorage.getItem(
|
|
18
|
+
`${e.appName}-auth-expires-at`
|
|
19
|
+
);
|
|
20
|
+
return r ? Number(r) : null;
|
|
21
|
+
}, [e.appName]), s = o(
|
|
22
|
+
() => window.location.protocol + "//" + window.location.hostname + (window.location.port ? `:${window.location.port}` : "") + (e.appBaseContext ?? ""),
|
|
23
|
+
[e.appBaseContext]
|
|
24
|
+
), l = o(
|
|
25
|
+
() => s + "/callback?location=" + window.location.href,
|
|
26
|
+
[s]
|
|
27
|
+
), m = o(
|
|
28
|
+
() => (e.appBaseContext ?? "") + "/callback",
|
|
29
|
+
[e.appBaseContext]
|
|
30
|
+
), i = w(
|
|
31
|
+
(r) => {
|
|
32
|
+
localStorage.setItem(`${e.appName}-auth-token`, r.token), localStorage.setItem(
|
|
33
|
+
`${e.appName}-auth-expires-at`,
|
|
34
|
+
r.expiresAt.toString()
|
|
35
|
+
), localStorage.removeItem(`${e.appName}-user-resource-id`), localStorage.removeItem(`${e.appName}-user-workspace-id`);
|
|
36
|
+
const d = new URLSearchParams(window.location.search);
|
|
37
|
+
window.location.href = d.get("location") ?? s;
|
|
38
|
+
},
|
|
39
|
+
[e.appName, s]
|
|
40
|
+
), h = o(
|
|
41
|
+
() => ({
|
|
42
|
+
getAuthToken: () => a && n && !c(a) ? n : (S(e.clientId, l, e.oAuthScopes), "")
|
|
43
|
+
}),
|
|
44
|
+
[e.clientId, e.oAuthScopes, a, l, n]
|
|
45
|
+
);
|
|
46
|
+
return !n || !a || c(a) ? /* @__PURE__ */ p(
|
|
47
|
+
k,
|
|
48
|
+
{
|
|
49
|
+
setAuth: i,
|
|
50
|
+
redirectUri: l,
|
|
51
|
+
oAuthScopes: e.oAuthScopes,
|
|
52
|
+
codeTokenExchangeUrl: e.codeTokenExchangeUrl,
|
|
53
|
+
callbackPath: m,
|
|
54
|
+
clientId: e.clientId
|
|
55
|
+
}
|
|
56
|
+
) : /* @__PURE__ */ p(u.Provider, { value: h, children: t });
|
|
65
57
|
}
|
|
66
|
-
function
|
|
67
|
-
return
|
|
58
|
+
function c(t) {
|
|
59
|
+
return t < Date.now();
|
|
68
60
|
}
|
|
69
61
|
export {
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
62
|
+
b as OAuthProvider,
|
|
63
|
+
b as default,
|
|
64
|
+
v as useOAuth
|
|
73
65
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),r=require("@atlaskit/primitives"),t=require("react-router-dom"),a=require("../ui-oauth-callback/index.cjs.js"),l=require("../ui-oauth-redirect-login/index.cjs.js"),x=r.xcss({paddingBlockStart:"space.1000"});function h({codeTokenExchangeUrl:u,clientId:o,oAuthScopes:n,redirectUri:s,callbackPath:i,setAuth:c}){return e.jsx(r.Flex,{justifyContent:"center",xcss:x,children:e.jsx(t.BrowserRouter,{children:e.jsxs(t.Routes,{children:[e.jsx(t.Route,{path:"/",element:e.jsx(l.OAuthRedirectLogin,{clientId:o,redirectUri:s,oAuthScopes:n})}),e.jsx(t.Route,{path:i,element:e.jsx(a.OAuthCallback,{setAuth:c,redirectUri:s,codeTokenExchangeUrl:u})}),e.jsx(t.Route,{path:"/*",element:e.jsx(t.Navigate,{to:"/",replace:!0})})]})})})}exports.OAuthRoutes=h;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { jsx as t, jsxs as m } from "react/jsx-runtime";
|
|
2
|
+
import { Flex as a, xcss as l } from "@atlaskit/primitives";
|
|
3
|
+
import { BrowserRouter as p, Routes as u, Route as e, Navigate as h } from "react-router-dom";
|
|
4
|
+
import { OAuthCallback as f } from "../ui-oauth-callback/index.es.js";
|
|
5
|
+
import { OAuthRedirectLogin as x } from "../ui-oauth-redirect-login/index.es.js";
|
|
6
|
+
const d = l({
|
|
7
|
+
paddingBlockStart: "space.1000"
|
|
8
|
+
});
|
|
9
|
+
function k({
|
|
10
|
+
codeTokenExchangeUrl: r,
|
|
11
|
+
clientId: n,
|
|
12
|
+
oAuthScopes: s,
|
|
13
|
+
redirectUri: o,
|
|
14
|
+
callbackPath: c,
|
|
15
|
+
setAuth: i
|
|
16
|
+
}) {
|
|
17
|
+
return /* @__PURE__ */ t(a, { justifyContent: "center", xcss: d, children: /* @__PURE__ */ t(p, { children: /* @__PURE__ */ m(u, { children: [
|
|
18
|
+
/* @__PURE__ */ t(
|
|
19
|
+
e,
|
|
20
|
+
{
|
|
21
|
+
path: "/",
|
|
22
|
+
element: /* @__PURE__ */ t(
|
|
23
|
+
x,
|
|
24
|
+
{
|
|
25
|
+
clientId: n,
|
|
26
|
+
redirectUri: o,
|
|
27
|
+
oAuthScopes: s
|
|
28
|
+
}
|
|
29
|
+
)
|
|
30
|
+
}
|
|
31
|
+
),
|
|
32
|
+
/* @__PURE__ */ t(
|
|
33
|
+
e,
|
|
34
|
+
{
|
|
35
|
+
path: c,
|
|
36
|
+
element: /* @__PURE__ */ t(
|
|
37
|
+
f,
|
|
38
|
+
{
|
|
39
|
+
setAuth: i,
|
|
40
|
+
redirectUri: o,
|
|
41
|
+
codeTokenExchangeUrl: r
|
|
42
|
+
}
|
|
43
|
+
)
|
|
44
|
+
}
|
|
45
|
+
),
|
|
46
|
+
/* @__PURE__ */ t(e, { path: "/*", element: /* @__PURE__ */ t(h, { to: "/", replace: !0 }) })
|
|
47
|
+
] }) }) });
|
|
48
|
+
}
|
|
49
|
+
export {
|
|
50
|
+
k as OAuthRoutes
|
|
51
|
+
};
|
package/atlassian/shared/frontend-ui-page-loading-view/src/lib/page-loading-view/index.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),s=require("@atlaskit/heading"),o=require("@atlaskit/primitives"),a=require("@atlaskit/section-message"),c=require("@atlaskit/spinner");function r({label:n,loadingError:i,labelSize:t}){return e.jsxs(o.Flex,{direction:"column",children:[e.jsx(s,{size:t
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),s=require("@atlaskit/heading"),o=require("@atlaskit/primitives"),a=require("@atlaskit/section-message"),c=require("@atlaskit/spinner");function r({label:n,loadingError:i,labelSize:t}){return e.jsxs(o.Flex,{direction:"column",children:[e.jsx(s,{size:t??"large",children:n}),i?e.jsx(a,{appearance:"error",children:i}):e.jsx(c,{interactionName:"load"})]})}exports.PageLoadingView=r;exports.default=r;
|
package/atlassian/shared/frontend-ui-page-loading-view/src/lib/page-loading-view/index.es.js
CHANGED
|
@@ -9,7 +9,7 @@ function g({
|
|
|
9
9
|
labelSize: o
|
|
10
10
|
}) {
|
|
11
11
|
return /* @__PURE__ */ n(a, { direction: "column", children: [
|
|
12
|
-
/* @__PURE__ */ e(t, { size: o
|
|
12
|
+
/* @__PURE__ */ e(t, { size: o ?? "large", children: i }),
|
|
13
13
|
r ? /* @__PURE__ */ e(m, { appearance: "error", children: r }) : /* @__PURE__ */ e(c, { interactionName: "load" })
|
|
14
14
|
] });
|
|
15
15
|
}
|
package/atlassian-app/index.d.ts
CHANGED
|
@@ -179,7 +179,7 @@
|
|
|
179
179
|
"excerptTokens": [
|
|
180
180
|
{
|
|
181
181
|
"kind": "Content",
|
|
182
|
-
"text": "export declare function AtlassianAppStandalone({ initialMockViewContext, backendUrl, remoteUrl, doCheckWorkspace, appName, doCheckResource, modalOpenerConfig, modalContextConfig, oauthConfig, children, }: "
|
|
182
|
+
"text": "export declare function AtlassianAppStandalone({ initialMockViewContext, backendUrl, remoteUrl, doCheckWorkspace, appName, doCheckResource, modalOpenerConfig, modalContextConfig, oauthConfig, atlassianResourceId, children, }: "
|
|
183
183
|
},
|
|
184
184
|
{
|
|
185
185
|
"kind": "Reference",
|
|
@@ -226,7 +226,7 @@
|
|
|
226
226
|
"overloadIndex": 1,
|
|
227
227
|
"parameters": [
|
|
228
228
|
{
|
|
229
|
-
"parameterName": "{ initialMockViewContext, backendUrl, remoteUrl, doCheckWorkspace, appName, doCheckResource, modalOpenerConfig, modalContextConfig, oauthConfig, children, }",
|
|
229
|
+
"parameterName": "{ initialMockViewContext, backendUrl, remoteUrl, doCheckWorkspace, appName, doCheckResource, modalOpenerConfig, modalContextConfig, oauthConfig, atlassianResourceId, children, }",
|
|
230
230
|
"parameterTypeTokenRange": {
|
|
231
231
|
"startIndex": 1,
|
|
232
232
|
"endIndex": 5
|
|
@@ -278,6 +278,33 @@
|
|
|
278
278
|
"endIndex": 2
|
|
279
279
|
}
|
|
280
280
|
},
|
|
281
|
+
{
|
|
282
|
+
"kind": "PropertySignature",
|
|
283
|
+
"canonicalReference": "@valiantys/atlassian-app-frontend!JiraStandaloneAppWrapperProps#atlassianResourceId:member",
|
|
284
|
+
"docComment": "",
|
|
285
|
+
"excerptTokens": [
|
|
286
|
+
{
|
|
287
|
+
"kind": "Content",
|
|
288
|
+
"text": "atlassianResourceId?: "
|
|
289
|
+
},
|
|
290
|
+
{
|
|
291
|
+
"kind": "Content",
|
|
292
|
+
"text": "string"
|
|
293
|
+
},
|
|
294
|
+
{
|
|
295
|
+
"kind": "Content",
|
|
296
|
+
"text": ";"
|
|
297
|
+
}
|
|
298
|
+
],
|
|
299
|
+
"isReadonly": false,
|
|
300
|
+
"isOptional": true,
|
|
301
|
+
"releaseTag": "Public",
|
|
302
|
+
"name": "atlassianResourceId",
|
|
303
|
+
"propertyTypeTokenRange": {
|
|
304
|
+
"startIndex": 1,
|
|
305
|
+
"endIndex": 2
|
|
306
|
+
}
|
|
307
|
+
},
|
|
281
308
|
{
|
|
282
309
|
"kind": "PropertySignature",
|
|
283
310
|
"canonicalReference": "@valiantys/atlassian-app-frontend!JiraStandaloneAppWrapperProps#backendUrl:member",
|
|
@@ -9,13 +9,15 @@ import { JSX as JSX_2 } from 'react/jsx-runtime';
|
|
|
9
9
|
import { PropsWithChildren } from 'react';
|
|
10
10
|
|
|
11
11
|
// @public (undocumented)
|
|
12
|
-
export function AtlassianAppStandalone({ initialMockViewContext, backendUrl, remoteUrl, doCheckWorkspace, appName, doCheckResource, modalOpenerConfig, modalContextConfig, oauthConfig, children, }: PropsWithChildren<JiraStandaloneAppWrapperProps>): JSX_2.Element;
|
|
12
|
+
export function AtlassianAppStandalone({ initialMockViewContext, backendUrl, remoteUrl, doCheckWorkspace, appName, doCheckResource, modalOpenerConfig, modalContextConfig, oauthConfig, atlassianResourceId, children, }: PropsWithChildren<JiraStandaloneAppWrapperProps>): JSX_2.Element;
|
|
13
13
|
|
|
14
14
|
// @public (undocumented)
|
|
15
15
|
export interface JiraStandaloneAppWrapperProps {
|
|
16
16
|
// (undocumented)
|
|
17
17
|
appName: string;
|
|
18
18
|
// (undocumented)
|
|
19
|
+
atlassianResourceId?: string;
|
|
20
|
+
// (undocumented)
|
|
19
21
|
backendUrl?: string;
|
|
20
22
|
// (undocumented)
|
|
21
23
|
doCheckResource?: boolean;
|
|
@@ -2,7 +2,7 @@ import { FullContext } from '@forge/bridge/out/types';
|
|
|
2
2
|
import { JSX as JSX_2 } from 'react/jsx-runtime';
|
|
3
3
|
import { PropsWithChildren } from 'react';
|
|
4
4
|
|
|
5
|
-
export declare function AtlassianAppStandalone({ initialMockViewContext, backendUrl, remoteUrl, doCheckWorkspace, appName, doCheckResource, modalOpenerConfig, modalContextConfig, oauthConfig, children, }: PropsWithChildren<JiraStandaloneAppWrapperProps>): JSX_2.Element;
|
|
5
|
+
export declare function AtlassianAppStandalone({ initialMockViewContext, backendUrl, remoteUrl, doCheckWorkspace, appName, doCheckResource, modalOpenerConfig, modalContextConfig, oauthConfig, atlassianResourceId, children, }: PropsWithChildren<JiraStandaloneAppWrapperProps>): JSX_2.Element;
|
|
6
6
|
|
|
7
7
|
declare type AtlassianAppStandaloneOauthConfig = OAuthProviderProps & {
|
|
8
8
|
doCheckResource?: boolean;
|
|
@@ -28,11 +28,13 @@ export declare interface JiraStandaloneAppWrapperProps {
|
|
|
28
28
|
};
|
|
29
29
|
appName: string;
|
|
30
30
|
oauthConfig?: AtlassianAppStandaloneOauthConfig;
|
|
31
|
+
atlassianResourceId?: string;
|
|
31
32
|
}
|
|
32
33
|
|
|
33
34
|
declare interface OAuthProviderProps {
|
|
34
35
|
clientId: string;
|
|
35
36
|
codeTokenExchangeUrl: string;
|
|
37
|
+
appBaseContext?: string;
|
|
36
38
|
/**
|
|
37
39
|
* OAuth App Name
|
|
38
40
|
*/
|
|
@@ -39,7 +39,7 @@ declare type FetchRoute = {
|
|
|
39
39
|
readonly value: string;
|
|
40
40
|
};
|
|
41
41
|
|
|
42
|
-
declare type FetchSignature = <T>(request: FetchRequest, body?:
|
|
42
|
+
declare type FetchSignature = <T>(request: FetchRequest, body?: any) => Promise<T>;
|
|
43
43
|
|
|
44
44
|
declare interface HostRouter {
|
|
45
45
|
navigate(url: string): Promise<void>;
|
|
@@ -225,7 +225,7 @@ declare type FetchRoute = {
|
|
|
225
225
|
readonly value: string;
|
|
226
226
|
};
|
|
227
227
|
|
|
228
|
-
declare type FetchSignature = <T>(request: FetchRequest, body?:
|
|
228
|
+
declare type FetchSignature = <T>(request: FetchRequest, body?: any) => Promise<T>;
|
|
229
229
|
|
|
230
230
|
export declare function getAssetLinkedIssues(fetch: AtlassianProductFetchService<'jira'>, workspaceId: string, objectId: string): Promise<ObjectConnectedTickets>;
|
|
231
231
|
|