@elliemae/pui-app-sdk 4.2.4 → 4.2.6
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.
|
@@ -24,10 +24,6 @@ __export(auth_exports, {
|
|
|
24
24
|
});
|
|
25
25
|
module.exports = __toCommonJS(auth_exports);
|
|
26
26
|
var import_http_client = require("../../communication/http-client/index.js");
|
|
27
|
-
var import_config = require("../../utils/app-config/config.js");
|
|
28
|
-
const getIDPClient = () => (0, import_http_client.getHTTPClient)({
|
|
29
|
-
baseURL: (0, import_config.getAppConfigValue)("serviceEndpoints.idp", "")
|
|
30
|
-
});
|
|
31
27
|
const getToken = async ({
|
|
32
28
|
clientId,
|
|
33
29
|
redirectUri,
|
|
@@ -38,7 +34,7 @@ const getToken = async ({
|
|
|
38
34
|
params.append("client_id", clientId);
|
|
39
35
|
params.append("redirect_uri", redirectUri);
|
|
40
36
|
params.append("code", idpCode);
|
|
41
|
-
const { data } = await
|
|
37
|
+
const { data } = await (0, import_http_client.getHTTPClient)().post(
|
|
42
38
|
"/oauth2/v1/token",
|
|
43
39
|
params
|
|
44
40
|
);
|
|
@@ -48,7 +44,7 @@ const revokeToken = async ({ clientId, token }) => {
|
|
|
48
44
|
const params = new URLSearchParams();
|
|
49
45
|
params.append("token", token);
|
|
50
46
|
params.append("client_id", clientId);
|
|
51
|
-
await
|
|
47
|
+
await (0, import_http_client.getHTTPClient)().post("/oauth2/v1/token/revocation", params);
|
|
52
48
|
};
|
|
53
49
|
const introspectToken = async ({
|
|
54
50
|
clientId,
|
|
@@ -57,7 +53,7 @@ const introspectToken = async ({
|
|
|
57
53
|
const params = new URLSearchParams();
|
|
58
54
|
params.append("token", accessToken);
|
|
59
55
|
params.append("client_id", clientId);
|
|
60
|
-
const { data } = await
|
|
56
|
+
const { data } = await (0, import_http_client.getHTTPClient)().post(
|
|
61
57
|
"/oauth2/v1/token/introspection",
|
|
62
58
|
params
|
|
63
59
|
);
|
|
@@ -36,6 +36,7 @@ var import_manifest = require("../resources/manifest.js");
|
|
|
36
36
|
const cssType = /\.css$/;
|
|
37
37
|
const isCss = (fileName) => cssType.test(fileName);
|
|
38
38
|
const activeApps = {};
|
|
39
|
+
const getPathName = (url) => url ? new URL(url).pathname : "";
|
|
39
40
|
const initApplication = async ({
|
|
40
41
|
id,
|
|
41
42
|
name,
|
|
@@ -45,7 +46,12 @@ const initApplication = async ({
|
|
|
45
46
|
manifestPath,
|
|
46
47
|
homeRoute
|
|
47
48
|
}) => {
|
|
48
|
-
const app =
|
|
49
|
+
const app = window.emui?.[id];
|
|
50
|
+
if (!app) {
|
|
51
|
+
throw new Error(
|
|
52
|
+
`Application ${name} with ${id} is not found. Most probably the appId property of app.config.json is not set to ${id}`
|
|
53
|
+
);
|
|
54
|
+
}
|
|
49
55
|
const { init } = app;
|
|
50
56
|
if (!init || typeof init !== "function")
|
|
51
57
|
throw new Error(
|
|
@@ -56,7 +62,7 @@ const initApplication = async ({
|
|
|
56
62
|
host: import_host.CMicroAppHost.getInstance(),
|
|
57
63
|
hostUrl,
|
|
58
64
|
manifestPath,
|
|
59
|
-
homeRoute,
|
|
65
|
+
homeRoute: homeRoute ?? getPathName(hostUrl),
|
|
60
66
|
prevState,
|
|
61
67
|
history,
|
|
62
68
|
theme,
|
|
@@ -1,8 +1,4 @@
|
|
|
1
1
|
import { getHTTPClient } from "../../communication/http-client/index.js";
|
|
2
|
-
import { getAppConfigValue } from "../../utils/app-config/config.js";
|
|
3
|
-
const getIDPClient = () => getHTTPClient({
|
|
4
|
-
baseURL: getAppConfigValue("serviceEndpoints.idp", "")
|
|
5
|
-
});
|
|
6
2
|
const getToken = async ({
|
|
7
3
|
clientId,
|
|
8
4
|
redirectUri,
|
|
@@ -13,7 +9,7 @@ const getToken = async ({
|
|
|
13
9
|
params.append("client_id", clientId);
|
|
14
10
|
params.append("redirect_uri", redirectUri);
|
|
15
11
|
params.append("code", idpCode);
|
|
16
|
-
const { data } = await
|
|
12
|
+
const { data } = await getHTTPClient().post(
|
|
17
13
|
"/oauth2/v1/token",
|
|
18
14
|
params
|
|
19
15
|
);
|
|
@@ -23,7 +19,7 @@ const revokeToken = async ({ clientId, token }) => {
|
|
|
23
19
|
const params = new URLSearchParams();
|
|
24
20
|
params.append("token", token);
|
|
25
21
|
params.append("client_id", clientId);
|
|
26
|
-
await
|
|
22
|
+
await getHTTPClient().post("/oauth2/v1/token/revocation", params);
|
|
27
23
|
};
|
|
28
24
|
const introspectToken = async ({
|
|
29
25
|
clientId,
|
|
@@ -32,7 +28,7 @@ const introspectToken = async ({
|
|
|
32
28
|
const params = new URLSearchParams();
|
|
33
29
|
params.append("token", accessToken);
|
|
34
30
|
params.append("client_id", clientId);
|
|
35
|
-
const { data } = await
|
|
31
|
+
const { data } = await getHTTPClient().post(
|
|
36
32
|
"/oauth2/v1/token/introspection",
|
|
37
33
|
params
|
|
38
34
|
);
|
|
@@ -23,6 +23,7 @@ import {
|
|
|
23
23
|
const cssType = /\.css$/;
|
|
24
24
|
const isCss = (fileName) => cssType.test(fileName);
|
|
25
25
|
const activeApps = {};
|
|
26
|
+
const getPathName = (url) => url ? new URL(url).pathname : "";
|
|
26
27
|
const initApplication = async ({
|
|
27
28
|
id,
|
|
28
29
|
name,
|
|
@@ -32,7 +33,12 @@ const initApplication = async ({
|
|
|
32
33
|
manifestPath,
|
|
33
34
|
homeRoute
|
|
34
35
|
}) => {
|
|
35
|
-
const app =
|
|
36
|
+
const app = window.emui?.[id];
|
|
37
|
+
if (!app) {
|
|
38
|
+
throw new Error(
|
|
39
|
+
`Application ${name} with ${id} is not found. Most probably the appId property of app.config.json is not set to ${id}`
|
|
40
|
+
);
|
|
41
|
+
}
|
|
36
42
|
const { init } = app;
|
|
37
43
|
if (!init || typeof init !== "function")
|
|
38
44
|
throw new Error(
|
|
@@ -43,7 +49,7 @@ const initApplication = async ({
|
|
|
43
49
|
host: CMicroAppHost.getInstance(),
|
|
44
50
|
hostUrl,
|
|
45
51
|
manifestPath,
|
|
46
|
-
homeRoute,
|
|
52
|
+
homeRoute: homeRoute ?? getPathName(hostUrl),
|
|
47
53
|
prevState,
|
|
48
54
|
history,
|
|
49
55
|
theme,
|