@elliemae/pui-app-sdk 5.0.0-next.1 → 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 response = await (0, import_http_client.getHTTPClient)().get(
43
- (0, import_url.removeDoubleSlash)(url.href)
44
- );
45
- const { headers } = response;
46
- if (headers["content-type"]?.includes?.("application/json"))
47
- return response.data;
48
- const unVersionedManifestPath = getUnVersionedManifestPath(manifestPath);
49
- if (manifestPath !== unVersionedManifestPath) {
50
- return getAppManifest({
51
- hostUrl,
52
- manifestPath: getUnVersionedManifestPath(manifestPath)
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 response = await getHTTPClient().get(
19
- removeDoubleSlash(url.href)
20
- );
21
- const { headers } = response;
22
- if (headers["content-type"]?.includes?.("application/json"))
23
- return response.data;
24
- const unVersionedManifestPath = getUnVersionedManifestPath(manifestPath);
25
- if (manifestPath !== unVersionedManifestPath) {
26
- return getAppManifest({
27
- hostUrl,
28
- manifestPath: getUnVersionedManifestPath(manifestPath)
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];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elliemae/pui-app-sdk",
3
- "version": "5.0.0-next.1",
3
+ "version": "5.0.1",
4
4
  "description": "ICE MT UI Platform Application SDK ",
5
5
  "sideEffects": [
6
6
  "*.css",