@elliemae/pui-app-sdk 5.0.0 → 5.0.1
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.
|
@@ -39,20 +39,27 @@ const getAppManifest = async ({
|
|
|
39
39
|
`${manifestPath.replace(/\/?$/, "/")}manifest.json`,
|
|
40
40
|
hostUrl
|
|
41
41
|
);
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
42
|
+
const getUnVersionedManifestJson = () => {
|
|
43
|
+
const unVersionedManifestPath = getUnVersionedManifestPath(manifestPath);
|
|
44
|
+
if (manifestPath !== unVersionedManifestPath) {
|
|
45
|
+
return getAppManifest({
|
|
46
|
+
hostUrl,
|
|
47
|
+
manifestPath: getUnVersionedManifestPath(manifestPath)
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
throw new Error("manifest.json is not available for the application");
|
|
51
|
+
};
|
|
52
|
+
try {
|
|
53
|
+
const response = await (0, import_http_client.getHTTPClient)().get(
|
|
54
|
+
(0, import_url.removeDoubleSlash)(url.href)
|
|
55
|
+
);
|
|
56
|
+
const { headers } = response;
|
|
57
|
+
if (headers["content-type"]?.includes?.("application/json"))
|
|
58
|
+
return response.data;
|
|
59
|
+
return await getUnVersionedManifestJson();
|
|
60
|
+
} catch (err) {
|
|
61
|
+
return getUnVersionedManifestJson();
|
|
54
62
|
}
|
|
55
|
-
throw new Error("manifest.json is not available for the application");
|
|
56
63
|
};
|
|
57
64
|
const getFullFileNameofAssetsFromManifest = (manifest, assetNames = []) => assetNames.reduce((assets, assetName) => {
|
|
58
65
|
const fullFileName = manifest[assetName];
|
|
@@ -15,20 +15,27 @@ const getAppManifest = async ({
|
|
|
15
15
|
`${manifestPath.replace(/\/?$/, "/")}manifest.json`,
|
|
16
16
|
hostUrl
|
|
17
17
|
);
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
18
|
+
const getUnVersionedManifestJson = () => {
|
|
19
|
+
const unVersionedManifestPath = getUnVersionedManifestPath(manifestPath);
|
|
20
|
+
if (manifestPath !== unVersionedManifestPath) {
|
|
21
|
+
return getAppManifest({
|
|
22
|
+
hostUrl,
|
|
23
|
+
manifestPath: getUnVersionedManifestPath(manifestPath)
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
throw new Error("manifest.json is not available for the application");
|
|
27
|
+
};
|
|
28
|
+
try {
|
|
29
|
+
const response = await getHTTPClient().get(
|
|
30
|
+
removeDoubleSlash(url.href)
|
|
31
|
+
);
|
|
32
|
+
const { headers } = response;
|
|
33
|
+
if (headers["content-type"]?.includes?.("application/json"))
|
|
34
|
+
return response.data;
|
|
35
|
+
return await getUnVersionedManifestJson();
|
|
36
|
+
} catch (err) {
|
|
37
|
+
return getUnVersionedManifestJson();
|
|
30
38
|
}
|
|
31
|
-
throw new Error("manifest.json is not available for the application");
|
|
32
39
|
};
|
|
33
40
|
const getFullFileNameofAssetsFromManifest = (manifest, assetNames = []) => assetNames.reduce((assets, assetName) => {
|
|
34
41
|
const fullFileName = manifest[assetName];
|