@elliemae/pui-app-sdk 4.12.0 → 4.13.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.
- package/dist/cjs/utils/log-records.js +15 -15
- package/dist/cjs/utils/micro-frontend/console-logger.js +1 -2
- package/dist/cjs/view/micro-app/app-factory/index.js +1 -1
- package/dist/cjs/view/micro-app/resources/manifest.js +21 -14
- package/dist/esm/utils/log-records.js +15 -15
- package/dist/esm/utils/micro-frontend/console-logger.js +1 -2
- package/dist/esm/view/micro-app/app-factory/index.js +1 -1
- package/dist/esm/view/micro-app/resources/manifest.js +21 -14
- package/dist/types/lib/utils/log-records.d.ts +36 -16
- package/package.json +5 -5
|
@@ -24,62 +24,62 @@ module.exports = __toCommonJS(log_records_exports);
|
|
|
24
24
|
const logRecords = {
|
|
25
25
|
ERR_TOAST_OPEN_FAILED: {
|
|
26
26
|
code: "appsdk001",
|
|
27
|
-
|
|
27
|
+
message: "Unable to open Error Toast"
|
|
28
28
|
},
|
|
29
29
|
WAIT_MSG_OPEN_FAILED: {
|
|
30
30
|
code: "appsdk02",
|
|
31
|
-
|
|
31
|
+
message: "Unable to open Wait message"
|
|
32
32
|
},
|
|
33
33
|
WAIT_MSG_CLOSE_FAILED: {
|
|
34
34
|
code: "appsdk03",
|
|
35
|
-
|
|
35
|
+
message: "Unable to close Wait message"
|
|
36
36
|
},
|
|
37
37
|
APP_CONFIG_LOAD_FAILED: {
|
|
38
38
|
code: "appsdk04",
|
|
39
|
-
|
|
39
|
+
message: "Unable to load application configuration"
|
|
40
40
|
},
|
|
41
41
|
ASSET_NOT_FOUND_IN_MANIFEST: (assetName) => ({
|
|
42
42
|
code: "appsdk05",
|
|
43
|
-
|
|
43
|
+
message: `Application load failed. unable to locate ${assetName} in the manifest`
|
|
44
44
|
}),
|
|
45
45
|
APP_INIT_FAILED: (appId, errMsg) => ({
|
|
46
46
|
code: "appsdk06",
|
|
47
|
-
|
|
47
|
+
message: `Application load failed. Unable to load one or more application resources for appId: ${appId}. ${errMsg}`
|
|
48
48
|
}),
|
|
49
49
|
APP_LOADING: (appId) => ({
|
|
50
50
|
code: "appsdk07",
|
|
51
|
-
|
|
51
|
+
message: `Application ${appId} is loading...`
|
|
52
52
|
}),
|
|
53
53
|
APP_LOADING_COMPLETE: (appId) => ({
|
|
54
54
|
code: "appsdk08",
|
|
55
|
-
|
|
55
|
+
message: `Application ${appId} loaded`
|
|
56
56
|
}),
|
|
57
57
|
APP_UNLOADING: (appId) => ({
|
|
58
58
|
code: "appsdk09",
|
|
59
|
-
|
|
59
|
+
message: `Application ${appId} unloading...`
|
|
60
60
|
}),
|
|
61
61
|
APP_UNLOADING_COMPLETE: (appId) => ({
|
|
62
62
|
code: "appsdk10",
|
|
63
|
-
|
|
63
|
+
message: `Application ${appId} unloaded`
|
|
64
64
|
}),
|
|
65
65
|
SSF_HOST_OBJECT_NOT_FOUND: (name) => ({
|
|
66
66
|
code: "appsdk11",
|
|
67
|
-
|
|
67
|
+
message: `Parent window doesn't expose SSF Object named ${name}`
|
|
68
68
|
}),
|
|
69
69
|
LOGIN_FAILED: {
|
|
70
70
|
code: "appsdk12",
|
|
71
|
-
|
|
71
|
+
message: "Unable to login the user."
|
|
72
72
|
},
|
|
73
73
|
LOGOUT_FAILED: {
|
|
74
74
|
code: "appsdk13",
|
|
75
|
-
|
|
75
|
+
message: "Unable to logout the user."
|
|
76
76
|
},
|
|
77
77
|
SERVICE_WORKER_FAILED: {
|
|
78
78
|
code: "appsdk14",
|
|
79
|
-
|
|
79
|
+
message: "Service Worker Registration Failed"
|
|
80
80
|
},
|
|
81
81
|
UNHANDLED_ERROR: {
|
|
82
82
|
code: "appsdk15",
|
|
83
|
-
|
|
83
|
+
message: "Unhandled error in react component"
|
|
84
84
|
}
|
|
85
85
|
};
|
|
@@ -30,11 +30,10 @@ const logger = (() => {
|
|
|
30
30
|
transport: (0, import_pui_diagnostics.Console)(),
|
|
31
31
|
index: "app",
|
|
32
32
|
environment: (0, import_config.getAppConfigValue)("activeEnv"),
|
|
33
|
-
logger: "icemt.app.logger",
|
|
34
33
|
team: "app team",
|
|
35
34
|
appName: "ICEMT App",
|
|
36
35
|
appVersion: "latest",
|
|
37
|
-
|
|
36
|
+
instanceId: "",
|
|
38
37
|
userId: ""
|
|
39
38
|
});
|
|
40
39
|
})();
|
|
@@ -116,7 +116,7 @@ const waitAndInitApplication = (appConfig, requests) => (
|
|
|
116
116
|
Promise.all(requests).then(addAppToActiveAppList.bind(null, appConfig.id)).then(initApplication.bind(null, appConfig)).catch((err) => {
|
|
117
117
|
const logRecord = import_log_records.logRecords.APP_INIT_FAILED(appConfig.id, err.message);
|
|
118
118
|
(0, import_micro_frontend.getLogger)().error({ ...logRecord, exception: err });
|
|
119
|
-
throw new Error(logRecord.
|
|
119
|
+
throw new Error(logRecord.message);
|
|
120
120
|
})
|
|
121
121
|
);
|
|
122
122
|
const removeAssetsFromDOM = (id, documentEle = document) => {
|
|
@@ -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];
|
|
@@ -61,7 +68,7 @@ const getFullFileNameofAssetsFromManifest = (manifest, assetNames = []) => asset
|
|
|
61
68
|
else {
|
|
62
69
|
const logRecord = import_log_records.logRecords.ASSET_NOT_FOUND_IN_MANIFEST(assetName);
|
|
63
70
|
(0, import_micro_frontend.getLogger)().error(logRecord);
|
|
64
|
-
throw new Error(logRecord.
|
|
71
|
+
throw new Error(logRecord.message);
|
|
65
72
|
}
|
|
66
73
|
return assets;
|
|
67
74
|
}, []);
|
|
@@ -1,63 +1,63 @@
|
|
|
1
1
|
const logRecords = {
|
|
2
2
|
ERR_TOAST_OPEN_FAILED: {
|
|
3
3
|
code: "appsdk001",
|
|
4
|
-
|
|
4
|
+
message: "Unable to open Error Toast"
|
|
5
5
|
},
|
|
6
6
|
WAIT_MSG_OPEN_FAILED: {
|
|
7
7
|
code: "appsdk02",
|
|
8
|
-
|
|
8
|
+
message: "Unable to open Wait message"
|
|
9
9
|
},
|
|
10
10
|
WAIT_MSG_CLOSE_FAILED: {
|
|
11
11
|
code: "appsdk03",
|
|
12
|
-
|
|
12
|
+
message: "Unable to close Wait message"
|
|
13
13
|
},
|
|
14
14
|
APP_CONFIG_LOAD_FAILED: {
|
|
15
15
|
code: "appsdk04",
|
|
16
|
-
|
|
16
|
+
message: "Unable to load application configuration"
|
|
17
17
|
},
|
|
18
18
|
ASSET_NOT_FOUND_IN_MANIFEST: (assetName) => ({
|
|
19
19
|
code: "appsdk05",
|
|
20
|
-
|
|
20
|
+
message: `Application load failed. unable to locate ${assetName} in the manifest`
|
|
21
21
|
}),
|
|
22
22
|
APP_INIT_FAILED: (appId, errMsg) => ({
|
|
23
23
|
code: "appsdk06",
|
|
24
|
-
|
|
24
|
+
message: `Application load failed. Unable to load one or more application resources for appId: ${appId}. ${errMsg}`
|
|
25
25
|
}),
|
|
26
26
|
APP_LOADING: (appId) => ({
|
|
27
27
|
code: "appsdk07",
|
|
28
|
-
|
|
28
|
+
message: `Application ${appId} is loading...`
|
|
29
29
|
}),
|
|
30
30
|
APP_LOADING_COMPLETE: (appId) => ({
|
|
31
31
|
code: "appsdk08",
|
|
32
|
-
|
|
32
|
+
message: `Application ${appId} loaded`
|
|
33
33
|
}),
|
|
34
34
|
APP_UNLOADING: (appId) => ({
|
|
35
35
|
code: "appsdk09",
|
|
36
|
-
|
|
36
|
+
message: `Application ${appId} unloading...`
|
|
37
37
|
}),
|
|
38
38
|
APP_UNLOADING_COMPLETE: (appId) => ({
|
|
39
39
|
code: "appsdk10",
|
|
40
|
-
|
|
40
|
+
message: `Application ${appId} unloaded`
|
|
41
41
|
}),
|
|
42
42
|
SSF_HOST_OBJECT_NOT_FOUND: (name) => ({
|
|
43
43
|
code: "appsdk11",
|
|
44
|
-
|
|
44
|
+
message: `Parent window doesn't expose SSF Object named ${name}`
|
|
45
45
|
}),
|
|
46
46
|
LOGIN_FAILED: {
|
|
47
47
|
code: "appsdk12",
|
|
48
|
-
|
|
48
|
+
message: "Unable to login the user."
|
|
49
49
|
},
|
|
50
50
|
LOGOUT_FAILED: {
|
|
51
51
|
code: "appsdk13",
|
|
52
|
-
|
|
52
|
+
message: "Unable to logout the user."
|
|
53
53
|
},
|
|
54
54
|
SERVICE_WORKER_FAILED: {
|
|
55
55
|
code: "appsdk14",
|
|
56
|
-
|
|
56
|
+
message: "Service Worker Registration Failed"
|
|
57
57
|
},
|
|
58
58
|
UNHANDLED_ERROR: {
|
|
59
59
|
code: "appsdk15",
|
|
60
|
-
|
|
60
|
+
message: "Unhandled error in react component"
|
|
61
61
|
}
|
|
62
62
|
};
|
|
63
63
|
export {
|
|
@@ -7,11 +7,10 @@ const logger = (() => {
|
|
|
7
7
|
transport: Console(),
|
|
8
8
|
index: "app",
|
|
9
9
|
environment: getAppConfigValue("activeEnv"),
|
|
10
|
-
logger: "icemt.app.logger",
|
|
11
10
|
team: "app team",
|
|
12
11
|
appName: "ICEMT App",
|
|
13
12
|
appVersion: "latest",
|
|
14
|
-
|
|
13
|
+
instanceId: "",
|
|
15
14
|
userId: ""
|
|
16
15
|
});
|
|
17
16
|
})();
|
|
@@ -103,7 +103,7 @@ const waitAndInitApplication = (appConfig, requests) => (
|
|
|
103
103
|
Promise.all(requests).then(addAppToActiveAppList.bind(null, appConfig.id)).then(initApplication.bind(null, appConfig)).catch((err) => {
|
|
104
104
|
const logRecord = logRecords.APP_INIT_FAILED(appConfig.id, err.message);
|
|
105
105
|
getLogger().error({ ...logRecord, exception: err });
|
|
106
|
-
throw new Error(logRecord.
|
|
106
|
+
throw new Error(logRecord.message);
|
|
107
107
|
})
|
|
108
108
|
);
|
|
109
109
|
const removeAssetsFromDOM = (id, documentEle = document) => {
|
|
@@ -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];
|
|
@@ -37,7 +44,7 @@ const getFullFileNameofAssetsFromManifest = (manifest, assetNames = []) => asset
|
|
|
37
44
|
else {
|
|
38
45
|
const logRecord = logRecords.ASSET_NOT_FOUND_IN_MANIFEST(assetName);
|
|
39
46
|
getLogger().error(logRecord);
|
|
40
|
-
throw new Error(logRecord.
|
|
47
|
+
throw new Error(logRecord.message);
|
|
41
48
|
}
|
|
42
49
|
return assets;
|
|
43
50
|
}, []);
|
|
@@ -1,42 +1,62 @@
|
|
|
1
|
-
import { InputLogRecord } from '@elliemae/pui-diagnostics';
|
|
2
1
|
export declare const logRecords: {
|
|
3
2
|
ERR_TOAST_OPEN_FAILED: {
|
|
4
3
|
code: string;
|
|
5
|
-
|
|
4
|
+
message: string;
|
|
6
5
|
};
|
|
7
6
|
WAIT_MSG_OPEN_FAILED: {
|
|
8
7
|
code: string;
|
|
9
|
-
|
|
8
|
+
message: string;
|
|
10
9
|
};
|
|
11
10
|
WAIT_MSG_CLOSE_FAILED: {
|
|
12
11
|
code: string;
|
|
13
|
-
|
|
12
|
+
message: string;
|
|
14
13
|
};
|
|
15
14
|
APP_CONFIG_LOAD_FAILED: {
|
|
16
15
|
code: string;
|
|
17
|
-
|
|
16
|
+
message: string;
|
|
17
|
+
};
|
|
18
|
+
ASSET_NOT_FOUND_IN_MANIFEST: (assetName: string) => {
|
|
19
|
+
code: string;
|
|
20
|
+
message: string;
|
|
21
|
+
};
|
|
22
|
+
APP_INIT_FAILED: (appId: string, errMsg: string) => {
|
|
23
|
+
code: string;
|
|
24
|
+
message: string;
|
|
25
|
+
};
|
|
26
|
+
APP_LOADING: (appId: string) => {
|
|
27
|
+
code: string;
|
|
28
|
+
message: string;
|
|
29
|
+
};
|
|
30
|
+
APP_LOADING_COMPLETE: (appId: string) => {
|
|
31
|
+
code: string;
|
|
32
|
+
message: string;
|
|
33
|
+
};
|
|
34
|
+
APP_UNLOADING: (appId: string) => {
|
|
35
|
+
code: string;
|
|
36
|
+
message: string;
|
|
37
|
+
};
|
|
38
|
+
APP_UNLOADING_COMPLETE: (appId: string) => {
|
|
39
|
+
code: string;
|
|
40
|
+
message: string;
|
|
41
|
+
};
|
|
42
|
+
SSF_HOST_OBJECT_NOT_FOUND: (name: string) => {
|
|
43
|
+
code: string;
|
|
44
|
+
message: string;
|
|
18
45
|
};
|
|
19
|
-
ASSET_NOT_FOUND_IN_MANIFEST: (assetName: string) => InputLogRecord;
|
|
20
|
-
APP_INIT_FAILED: (appId: string, errMsg: string) => InputLogRecord;
|
|
21
|
-
APP_LOADING: (appId: string) => InputLogRecord;
|
|
22
|
-
APP_LOADING_COMPLETE: (appId: string) => InputLogRecord;
|
|
23
|
-
APP_UNLOADING: (appId: string) => InputLogRecord;
|
|
24
|
-
APP_UNLOADING_COMPLETE: (appId: string) => InputLogRecord;
|
|
25
|
-
SSF_HOST_OBJECT_NOT_FOUND: (name: string) => InputLogRecord;
|
|
26
46
|
LOGIN_FAILED: {
|
|
27
47
|
code: string;
|
|
28
|
-
|
|
48
|
+
message: string;
|
|
29
49
|
};
|
|
30
50
|
LOGOUT_FAILED: {
|
|
31
51
|
code: string;
|
|
32
|
-
|
|
52
|
+
message: string;
|
|
33
53
|
};
|
|
34
54
|
SERVICE_WORKER_FAILED: {
|
|
35
55
|
code: string;
|
|
36
|
-
|
|
56
|
+
message: string;
|
|
37
57
|
};
|
|
38
58
|
UNHANDLED_ERROR: {
|
|
39
59
|
code: string;
|
|
40
|
-
|
|
60
|
+
message: string;
|
|
41
61
|
};
|
|
42
62
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/pui-app-sdk",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.13.1",
|
|
4
4
|
"description": "ICE MT UI Platform Application SDK ",
|
|
5
5
|
"sideEffects": [
|
|
6
6
|
"*.css",
|
|
@@ -128,11 +128,11 @@
|
|
|
128
128
|
"@elliemae/ds-popperjs": "^3.13.2",
|
|
129
129
|
"@elliemae/ds-toast": "^3.13.2",
|
|
130
130
|
"@elliemae/em-ssf-guest": "^1.11.2",
|
|
131
|
-
"@elliemae/pui-diagnostics": "^
|
|
131
|
+
"@elliemae/pui-diagnostics": "^3.0.1",
|
|
132
132
|
"@elliemae/pui-micro-frontend-base": "^1.14.0",
|
|
133
133
|
"@elliemae/pui-scripting-object": "^1.19.0",
|
|
134
134
|
"@elliemae/pui-theme": "^2.6.0",
|
|
135
|
-
"@elliemae/pui-user-monitoring": "^1.
|
|
135
|
+
"@elliemae/pui-user-monitoring": "^1.19.0"
|
|
136
136
|
},
|
|
137
137
|
"devDependencies": {
|
|
138
138
|
"@elliemae/app-react-dependencies": "~4.6.1",
|
|
@@ -154,13 +154,13 @@
|
|
|
154
154
|
"@elliemae/ds-toast": "~3.13.2",
|
|
155
155
|
"@elliemae/em-ssf-guest": "~1.11.2",
|
|
156
156
|
"@elliemae/pui-cli": "~7.27.1",
|
|
157
|
-
"@elliemae/pui-diagnostics": "~
|
|
157
|
+
"@elliemae/pui-diagnostics": "~3.0.1",
|
|
158
158
|
"@elliemae/pui-doc-gen": "~1.4.1",
|
|
159
159
|
"@elliemae/pui-e2e-test-sdk": "~7.7.1",
|
|
160
160
|
"@elliemae/pui-micro-frontend-base": "~1.14.0",
|
|
161
161
|
"@elliemae/pui-scripting-object": "~1.19.0",
|
|
162
162
|
"@elliemae/pui-theme": "~2.6.0",
|
|
163
|
-
"@elliemae/pui-user-monitoring": "~1.
|
|
163
|
+
"@elliemae/pui-user-monitoring": "~1.19.0",
|
|
164
164
|
"@types/react-aria-live": "~2.0.2"
|
|
165
165
|
}
|
|
166
166
|
}
|