@elliemae/pui-app-sdk 5.12.0 → 5.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/analytics/index.js +10 -5
- package/dist/cjs/analytics/page-view-event.js +1 -19
- package/dist/cjs/utils/helpers.js +21 -0
- package/dist/cjs/utils/micro-frontend/scripting-objects/analytics.js +46 -27
- package/dist/esm/analytics/index.js +10 -5
- package/dist/esm/analytics/page-view-event.js +1 -19
- package/dist/esm/utils/helpers.js +21 -0
- package/dist/esm/utils/micro-frontend/scripting-objects/analytics.js +46 -27
- package/dist/types/lib/analytics/index.d.ts +7 -0
- package/dist/types/lib/utils/helpers.d.ts +10 -0
- package/dist/types/lib/utils/micro-frontend/scripting-objects/analytics.d.ts +14 -14
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +7 -7
|
@@ -23,23 +23,28 @@ __export(analytics_exports, {
|
|
|
23
23
|
module.exports = __toCommonJS(analytics_exports);
|
|
24
24
|
var import_guest = require("../utils/micro-frontend/guest.js");
|
|
25
25
|
var import_web_analytics = require("../utils/micro-frontend/scripting-objects/web-analytics.js");
|
|
26
|
+
var import_helpers = require("../utils/helpers.js");
|
|
26
27
|
const sendBAEventToSelf = (data) => {
|
|
28
|
+
const eventData = {
|
|
29
|
+
...(0, import_web_analytics.getBAEventParameters)(),
|
|
30
|
+
...(0, import_helpers.getProductAppDetails)(),
|
|
31
|
+
...data
|
|
32
|
+
};
|
|
27
33
|
window.gtmDataLayer = window.gtmDataLayer || [];
|
|
28
|
-
window.gtmDataLayer.push(
|
|
34
|
+
window.gtmDataLayer.push(eventData);
|
|
29
35
|
};
|
|
30
36
|
const sendBAEvent = ({
|
|
31
37
|
data,
|
|
32
38
|
self = true
|
|
33
39
|
}) => {
|
|
34
|
-
const eventData = { ...(0, import_web_analytics.getBAEventParameters)(), ...data };
|
|
35
40
|
if (!self) {
|
|
36
41
|
const sendEvent = import_guest.CMicroAppGuest.getInstance()?.getHost()?.sendBAEvent;
|
|
37
42
|
if (sendEvent) {
|
|
38
|
-
sendEvent(
|
|
43
|
+
sendEvent(data);
|
|
39
44
|
} else {
|
|
40
|
-
sendBAEventToSelf(
|
|
45
|
+
sendBAEventToSelf(data);
|
|
41
46
|
}
|
|
42
47
|
} else {
|
|
43
|
-
sendBAEventToSelf(
|
|
48
|
+
sendBAEventToSelf(data);
|
|
44
49
|
}
|
|
45
50
|
};
|
|
@@ -22,29 +22,11 @@ __export(page_view_event_exports, {
|
|
|
22
22
|
});
|
|
23
23
|
module.exports = __toCommonJS(page_view_event_exports);
|
|
24
24
|
var import_index = require("./index.js");
|
|
25
|
-
const getWindow = () => {
|
|
26
|
-
try {
|
|
27
|
-
window.top?.document;
|
|
28
|
-
return window.top || window.self;
|
|
29
|
-
} catch (e) {
|
|
30
|
-
return window.self;
|
|
31
|
-
}
|
|
32
|
-
};
|
|
33
25
|
const pageViewEvent = ({ pageTitle }) => {
|
|
34
|
-
const pageWindow = getWindow();
|
|
35
|
-
const { pathname, href } = pageWindow.location;
|
|
36
|
-
const { title } = pageWindow.document;
|
|
37
|
-
const { pathname: guestPagePath, href: guestPageUrl } = window.location;
|
|
38
|
-
const { title: guestPageTitle } = document;
|
|
39
26
|
(0, import_index.sendBAEvent)({
|
|
40
27
|
data: {
|
|
41
28
|
event: "pageView",
|
|
42
|
-
|
|
43
|
-
pagePath: pathname,
|
|
44
|
-
pageTitle: title,
|
|
45
|
-
guestPageUrl,
|
|
46
|
-
guestPagePath,
|
|
47
|
-
guestPageTitle: pageTitle || guestPageTitle
|
|
29
|
+
appPageTitle: pageTitle
|
|
48
30
|
}
|
|
49
31
|
});
|
|
50
32
|
};
|
|
@@ -19,10 +19,12 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
19
19
|
var helpers_exports = {};
|
|
20
20
|
__export(helpers_exports, {
|
|
21
21
|
convertRelativeToAbsoluteUrl: () => convertRelativeToAbsoluteUrl,
|
|
22
|
+
getProductAppDetails: () => getProductAppDetails,
|
|
22
23
|
isCIBuild: () => isCIBuild,
|
|
23
24
|
isProd: () => isProd
|
|
24
25
|
});
|
|
25
26
|
module.exports = __toCommonJS(helpers_exports);
|
|
27
|
+
var import_window = require("./window.js");
|
|
26
28
|
const isProd = () => false;
|
|
27
29
|
const isCIBuild = () => process.env.CI === "true";
|
|
28
30
|
const PROTOCOL = /^(?:[a-z]+:)?\/\//;
|
|
@@ -32,3 +34,22 @@ const convertRelativeToAbsoluteUrl = (url) => {
|
|
|
32
34
|
}
|
|
33
35
|
return url;
|
|
34
36
|
};
|
|
37
|
+
const getProductAppDetails = () => {
|
|
38
|
+
const pageWindow = (0, import_window.getWindow)();
|
|
39
|
+
const { title: productPageTitle } = pageWindow.document;
|
|
40
|
+
const { title: appPageTitle } = document;
|
|
41
|
+
const productId = pageWindow?.emui?.appId ?? "";
|
|
42
|
+
const appId = window?.emui?.appId ?? "";
|
|
43
|
+
const { pathname: productPath, href: productUrl } = pageWindow.location;
|
|
44
|
+
const { pathname: appPath, href: appUrl } = window.location;
|
|
45
|
+
return {
|
|
46
|
+
productId,
|
|
47
|
+
productPath,
|
|
48
|
+
productUrl,
|
|
49
|
+
productPageTitle,
|
|
50
|
+
appId,
|
|
51
|
+
appPath,
|
|
52
|
+
appUrl,
|
|
53
|
+
appPageTitle
|
|
54
|
+
};
|
|
55
|
+
};
|
|
@@ -33,6 +33,7 @@ __export(analytics_exports, {
|
|
|
33
33
|
module.exports = __toCommonJS(analytics_exports);
|
|
34
34
|
var import_em_ssf_host = __toESM(require("@elliemae/em-ssf-host"));
|
|
35
35
|
var import_web_analytics = require("./web-analytics.js");
|
|
36
|
+
var import_helpers = require("../../helpers.js");
|
|
36
37
|
class Analytics extends import_em_ssf_host.default.ScriptingObject {
|
|
37
38
|
/**
|
|
38
39
|
* logger instance
|
|
@@ -64,6 +65,7 @@ class Analytics extends import_em_ssf_host.default.ScriptingObject {
|
|
|
64
65
|
startTime: new Date(
|
|
65
66
|
performance.timeOrigin + entry.startTime
|
|
66
67
|
).toISOString(),
|
|
68
|
+
...(0, import_web_analytics.getBAEventParameters)(),
|
|
67
69
|
...detail
|
|
68
70
|
}).catch(() => {
|
|
69
71
|
});
|
|
@@ -88,57 +90,74 @@ class Analytics extends import_em_ssf_host.default.ScriptingObject {
|
|
|
88
90
|
* @returns promise
|
|
89
91
|
*/
|
|
90
92
|
sendBAEvent = (event) => {
|
|
91
|
-
const eventEx = {
|
|
93
|
+
const eventEx = {
|
|
94
|
+
...(0, import_web_analytics.getBAEventParameters)(),
|
|
95
|
+
...(0, import_helpers.getProductAppDetails)(),
|
|
96
|
+
...event
|
|
97
|
+
};
|
|
92
98
|
window.gtmDataLayer = window.gtmDataLayer || [];
|
|
93
99
|
window.gtmDataLayer.push(eventEx);
|
|
94
100
|
return Promise.resolve();
|
|
95
101
|
};
|
|
96
102
|
/**
|
|
97
|
-
* start
|
|
98
|
-
* @param
|
|
99
|
-
* @param
|
|
103
|
+
* start timing measure
|
|
104
|
+
* @param name unique name for the timing measurement. If a measurement with the same name is already running, it will be replaced
|
|
105
|
+
* @param options additional details related to the measurement
|
|
100
106
|
* @returns a promise that resolves to a PerformanceMeasure object
|
|
101
107
|
*/
|
|
102
|
-
|
|
103
|
-
if (!
|
|
104
|
-
|
|
108
|
+
startTiming = (name, options) => {
|
|
109
|
+
if (!name) throw new Error("parameter mark is required");
|
|
110
|
+
if (!options || !options?.appId || !options?.appUrl)
|
|
111
|
+
throw new Error("parameter options is required");
|
|
112
|
+
const startMark = performance.mark(name, { detail: options });
|
|
105
113
|
return Promise.resolve(startMark);
|
|
106
114
|
};
|
|
107
115
|
/**
|
|
108
|
-
* end
|
|
109
|
-
* @param
|
|
110
|
-
* @param
|
|
111
|
-
* @returns a promise that resolves when the
|
|
116
|
+
* end timing measure
|
|
117
|
+
* @param start name used to start timing measure or return value of the startTiming method
|
|
118
|
+
* @param options additional details related to the measurement
|
|
119
|
+
* @returns a promise that resolves when the timing measurement is ended
|
|
112
120
|
* @example
|
|
113
121
|
* ```typescript
|
|
114
|
-
* const
|
|
122
|
+
* const longTaskMeasurement = await analytics.startTiming('LongTask', { appId: 'myApp', appUrl: 'https://myapp.com' });
|
|
115
123
|
* // do some work
|
|
116
|
-
* await analytics.
|
|
124
|
+
* await analytics.endTiming(longTaskMeasurement, { appId: 'myApp', appUrl: 'https://myapp.com' });
|
|
117
125
|
* ```
|
|
118
126
|
* ```typescript
|
|
119
|
-
* await analytics.
|
|
127
|
+
* const longTaskMeasurement = await analytics.startTiming('LongTask', { appId: 'myApp', appUrl: 'https://myapp.com' });
|
|
120
128
|
* // do some work
|
|
121
|
-
* await analytics.
|
|
129
|
+
* await analytics.endTiming('LongTask', { appId: 'loanApp', appUrl: 'https://loanApp.com' });
|
|
122
130
|
* ```
|
|
123
131
|
*/
|
|
124
|
-
|
|
125
|
-
if (!
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
132
|
+
endTiming = (start, options) => {
|
|
133
|
+
if (!start) throw new Error("parameter start is required");
|
|
134
|
+
if (!options || !options?.appId || !options?.appUrl)
|
|
135
|
+
throw new Error("parameter options is required");
|
|
136
|
+
const measurementName = start.name ?? start;
|
|
137
|
+
const startMark = performance.getEntriesByName(
|
|
138
|
+
measurementName,
|
|
139
|
+
"mark"
|
|
140
|
+
)?.[0];
|
|
141
|
+
const detail = {
|
|
142
|
+
startAppId: startMark?.detail?.appId ?? options.appId,
|
|
143
|
+
startAppUrl: startMark?.detail?.appUrl ?? options.appUrl,
|
|
144
|
+
endAppId: options.appId,
|
|
145
|
+
endAppUrl: options.appUrl
|
|
146
|
+
};
|
|
147
|
+
if (startMark) {
|
|
148
|
+
if (typeof start === "string")
|
|
149
|
+
performance.measure(measurementName, {
|
|
131
150
|
detail,
|
|
132
|
-
start:
|
|
151
|
+
start: measurementName
|
|
133
152
|
});
|
|
134
153
|
else
|
|
135
|
-
performance.measure(
|
|
154
|
+
performance.measure(measurementName, {
|
|
136
155
|
detail,
|
|
137
|
-
start:
|
|
156
|
+
start: start.startTime
|
|
138
157
|
});
|
|
139
|
-
performance.clearMarks(
|
|
158
|
+
performance.clearMarks(measurementName);
|
|
140
159
|
} else {
|
|
141
|
-
performance.measure(
|
|
160
|
+
performance.measure(measurementName, { detail });
|
|
142
161
|
}
|
|
143
162
|
return Promise.resolve();
|
|
144
163
|
};
|
|
@@ -1,23 +1,28 @@
|
|
|
1
1
|
import { CMicroAppGuest } from "../utils/micro-frontend/guest.js";
|
|
2
2
|
import { getBAEventParameters } from "../utils/micro-frontend/scripting-objects/web-analytics.js";
|
|
3
|
+
import { getProductAppDetails } from "../utils/helpers.js";
|
|
3
4
|
const sendBAEventToSelf = (data) => {
|
|
5
|
+
const eventData = {
|
|
6
|
+
...getBAEventParameters(),
|
|
7
|
+
...getProductAppDetails(),
|
|
8
|
+
...data
|
|
9
|
+
};
|
|
4
10
|
window.gtmDataLayer = window.gtmDataLayer || [];
|
|
5
|
-
window.gtmDataLayer.push(
|
|
11
|
+
window.gtmDataLayer.push(eventData);
|
|
6
12
|
};
|
|
7
13
|
const sendBAEvent = ({
|
|
8
14
|
data,
|
|
9
15
|
self = true
|
|
10
16
|
}) => {
|
|
11
|
-
const eventData = { ...getBAEventParameters(), ...data };
|
|
12
17
|
if (!self) {
|
|
13
18
|
const sendEvent = CMicroAppGuest.getInstance()?.getHost()?.sendBAEvent;
|
|
14
19
|
if (sendEvent) {
|
|
15
|
-
sendEvent(
|
|
20
|
+
sendEvent(data);
|
|
16
21
|
} else {
|
|
17
|
-
sendBAEventToSelf(
|
|
22
|
+
sendBAEventToSelf(data);
|
|
18
23
|
}
|
|
19
24
|
} else {
|
|
20
|
-
sendBAEventToSelf(
|
|
25
|
+
sendBAEventToSelf(data);
|
|
21
26
|
}
|
|
22
27
|
};
|
|
23
28
|
export {
|
|
@@ -1,27 +1,9 @@
|
|
|
1
1
|
import { sendBAEvent } from "./index.js";
|
|
2
|
-
const getWindow = () => {
|
|
3
|
-
try {
|
|
4
|
-
window.top?.document;
|
|
5
|
-
return window.top || window.self;
|
|
6
|
-
} catch (e) {
|
|
7
|
-
return window.self;
|
|
8
|
-
}
|
|
9
|
-
};
|
|
10
2
|
const pageViewEvent = ({ pageTitle }) => {
|
|
11
|
-
const pageWindow = getWindow();
|
|
12
|
-
const { pathname, href } = pageWindow.location;
|
|
13
|
-
const { title } = pageWindow.document;
|
|
14
|
-
const { pathname: guestPagePath, href: guestPageUrl } = window.location;
|
|
15
|
-
const { title: guestPageTitle } = document;
|
|
16
3
|
sendBAEvent({
|
|
17
4
|
data: {
|
|
18
5
|
event: "pageView",
|
|
19
|
-
|
|
20
|
-
pagePath: pathname,
|
|
21
|
-
pageTitle: title,
|
|
22
|
-
guestPageUrl,
|
|
23
|
-
guestPagePath,
|
|
24
|
-
guestPageTitle: pageTitle || guestPageTitle
|
|
6
|
+
appPageTitle: pageTitle
|
|
25
7
|
}
|
|
26
8
|
});
|
|
27
9
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { getWindow } from "./window.js";
|
|
1
2
|
const isProd = () => false;
|
|
2
3
|
const isCIBuild = () => process.env.CI === "true";
|
|
3
4
|
const PROTOCOL = /^(?:[a-z]+:)?\/\//;
|
|
@@ -7,8 +8,28 @@ const convertRelativeToAbsoluteUrl = (url) => {
|
|
|
7
8
|
}
|
|
8
9
|
return url;
|
|
9
10
|
};
|
|
11
|
+
const getProductAppDetails = () => {
|
|
12
|
+
const pageWindow = getWindow();
|
|
13
|
+
const { title: productPageTitle } = pageWindow.document;
|
|
14
|
+
const { title: appPageTitle } = document;
|
|
15
|
+
const productId = pageWindow?.emui?.appId ?? "";
|
|
16
|
+
const appId = window?.emui?.appId ?? "";
|
|
17
|
+
const { pathname: productPath, href: productUrl } = pageWindow.location;
|
|
18
|
+
const { pathname: appPath, href: appUrl } = window.location;
|
|
19
|
+
return {
|
|
20
|
+
productId,
|
|
21
|
+
productPath,
|
|
22
|
+
productUrl,
|
|
23
|
+
productPageTitle,
|
|
24
|
+
appId,
|
|
25
|
+
appPath,
|
|
26
|
+
appUrl,
|
|
27
|
+
appPageTitle
|
|
28
|
+
};
|
|
29
|
+
};
|
|
10
30
|
export {
|
|
11
31
|
convertRelativeToAbsoluteUrl,
|
|
32
|
+
getProductAppDetails,
|
|
12
33
|
isCIBuild,
|
|
13
34
|
isProd
|
|
14
35
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import ssfHost from "@elliemae/em-ssf-host";
|
|
2
2
|
import { getBAEventParameters } from "./web-analytics.js";
|
|
3
|
+
import { getProductAppDetails } from "../../helpers.js";
|
|
3
4
|
class Analytics extends ssfHost.ScriptingObject {
|
|
4
5
|
/**
|
|
5
6
|
* logger instance
|
|
@@ -31,6 +32,7 @@ class Analytics extends ssfHost.ScriptingObject {
|
|
|
31
32
|
startTime: new Date(
|
|
32
33
|
performance.timeOrigin + entry.startTime
|
|
33
34
|
).toISOString(),
|
|
35
|
+
...getBAEventParameters(),
|
|
34
36
|
...detail
|
|
35
37
|
}).catch(() => {
|
|
36
38
|
});
|
|
@@ -55,57 +57,74 @@ class Analytics extends ssfHost.ScriptingObject {
|
|
|
55
57
|
* @returns promise
|
|
56
58
|
*/
|
|
57
59
|
sendBAEvent = (event) => {
|
|
58
|
-
const eventEx = {
|
|
60
|
+
const eventEx = {
|
|
61
|
+
...getBAEventParameters(),
|
|
62
|
+
...getProductAppDetails(),
|
|
63
|
+
...event
|
|
64
|
+
};
|
|
59
65
|
window.gtmDataLayer = window.gtmDataLayer || [];
|
|
60
66
|
window.gtmDataLayer.push(eventEx);
|
|
61
67
|
return Promise.resolve();
|
|
62
68
|
};
|
|
63
69
|
/**
|
|
64
|
-
* start
|
|
65
|
-
* @param
|
|
66
|
-
* @param
|
|
70
|
+
* start timing measure
|
|
71
|
+
* @param name unique name for the timing measurement. If a measurement with the same name is already running, it will be replaced
|
|
72
|
+
* @param options additional details related to the measurement
|
|
67
73
|
* @returns a promise that resolves to a PerformanceMeasure object
|
|
68
74
|
*/
|
|
69
|
-
|
|
70
|
-
if (!
|
|
71
|
-
|
|
75
|
+
startTiming = (name, options) => {
|
|
76
|
+
if (!name) throw new Error("parameter mark is required");
|
|
77
|
+
if (!options || !options?.appId || !options?.appUrl)
|
|
78
|
+
throw new Error("parameter options is required");
|
|
79
|
+
const startMark = performance.mark(name, { detail: options });
|
|
72
80
|
return Promise.resolve(startMark);
|
|
73
81
|
};
|
|
74
82
|
/**
|
|
75
|
-
* end
|
|
76
|
-
* @param
|
|
77
|
-
* @param
|
|
78
|
-
* @returns a promise that resolves when the
|
|
83
|
+
* end timing measure
|
|
84
|
+
* @param start name used to start timing measure or return value of the startTiming method
|
|
85
|
+
* @param options additional details related to the measurement
|
|
86
|
+
* @returns a promise that resolves when the timing measurement is ended
|
|
79
87
|
* @example
|
|
80
88
|
* ```typescript
|
|
81
|
-
* const
|
|
89
|
+
* const longTaskMeasurement = await analytics.startTiming('LongTask', { appId: 'myApp', appUrl: 'https://myapp.com' });
|
|
82
90
|
* // do some work
|
|
83
|
-
* await analytics.
|
|
91
|
+
* await analytics.endTiming(longTaskMeasurement, { appId: 'myApp', appUrl: 'https://myapp.com' });
|
|
84
92
|
* ```
|
|
85
93
|
* ```typescript
|
|
86
|
-
* await analytics.
|
|
94
|
+
* const longTaskMeasurement = await analytics.startTiming('LongTask', { appId: 'myApp', appUrl: 'https://myapp.com' });
|
|
87
95
|
* // do some work
|
|
88
|
-
* await analytics.
|
|
96
|
+
* await analytics.endTiming('LongTask', { appId: 'loanApp', appUrl: 'https://loanApp.com' });
|
|
89
97
|
* ```
|
|
90
98
|
*/
|
|
91
|
-
|
|
92
|
-
if (!
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
99
|
+
endTiming = (start, options) => {
|
|
100
|
+
if (!start) throw new Error("parameter start is required");
|
|
101
|
+
if (!options || !options?.appId || !options?.appUrl)
|
|
102
|
+
throw new Error("parameter options is required");
|
|
103
|
+
const measurementName = start.name ?? start;
|
|
104
|
+
const startMark = performance.getEntriesByName(
|
|
105
|
+
measurementName,
|
|
106
|
+
"mark"
|
|
107
|
+
)?.[0];
|
|
108
|
+
const detail = {
|
|
109
|
+
startAppId: startMark?.detail?.appId ?? options.appId,
|
|
110
|
+
startAppUrl: startMark?.detail?.appUrl ?? options.appUrl,
|
|
111
|
+
endAppId: options.appId,
|
|
112
|
+
endAppUrl: options.appUrl
|
|
113
|
+
};
|
|
114
|
+
if (startMark) {
|
|
115
|
+
if (typeof start === "string")
|
|
116
|
+
performance.measure(measurementName, {
|
|
98
117
|
detail,
|
|
99
|
-
start:
|
|
118
|
+
start: measurementName
|
|
100
119
|
});
|
|
101
120
|
else
|
|
102
|
-
performance.measure(
|
|
121
|
+
performance.measure(measurementName, {
|
|
103
122
|
detail,
|
|
104
|
-
start:
|
|
123
|
+
start: start.startTime
|
|
105
124
|
});
|
|
106
|
-
performance.clearMarks(
|
|
125
|
+
performance.clearMarks(measurementName);
|
|
107
126
|
} else {
|
|
108
|
-
performance.measure(
|
|
127
|
+
performance.measure(measurementName, { detail });
|
|
109
128
|
}
|
|
110
129
|
return Promise.resolve();
|
|
111
130
|
};
|
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
import { BAEvent } from '@elliemae/pui-micro-frontend-base';
|
|
2
|
+
/**
|
|
3
|
+
* Sends business analytics event
|
|
4
|
+
* @param root0
|
|
5
|
+
* @param root0.data
|
|
6
|
+
* @param root0.self
|
|
7
|
+
* @deprecated use Analytics.sendBAEvent scripting object method instead
|
|
8
|
+
*/
|
|
2
9
|
export declare const sendBAEvent: ({ data, self, }: {
|
|
3
10
|
data: BAEvent;
|
|
4
11
|
self?: boolean;
|
|
@@ -1,3 +1,13 @@
|
|
|
1
1
|
export declare const isProd: () => boolean;
|
|
2
2
|
export declare const isCIBuild: () => boolean;
|
|
3
3
|
export declare const convertRelativeToAbsoluteUrl: (url: string) => string;
|
|
4
|
+
export declare const getProductAppDetails: () => {
|
|
5
|
+
productId: string;
|
|
6
|
+
productPath: string;
|
|
7
|
+
productUrl: string;
|
|
8
|
+
productPageTitle: string;
|
|
9
|
+
appId: string;
|
|
10
|
+
appPath: string;
|
|
11
|
+
appUrl: string;
|
|
12
|
+
appPageTitle: string;
|
|
13
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import ssfHost from '@elliemae/em-ssf-host';
|
|
2
|
-
import { IAnalytics, BAEvent } from '@elliemae/pui-scripting-object';
|
|
2
|
+
import { IAnalytics, BAEvent, TimingOptions } from '@elliemae/pui-scripting-object';
|
|
3
3
|
import { MicroFrontEndLogger } from '../../types.js';
|
|
4
4
|
/**
|
|
5
5
|
* Analytics scripting object
|
|
@@ -18,28 +18,28 @@ export declare class Analytics extends ssfHost.ScriptingObject implements IAnaly
|
|
|
18
18
|
*/
|
|
19
19
|
sendBAEvent: (event: BAEvent) => Promise<void>;
|
|
20
20
|
/**
|
|
21
|
-
* start
|
|
22
|
-
* @param
|
|
23
|
-
* @param
|
|
21
|
+
* start timing measure
|
|
22
|
+
* @param name unique name for the timing measurement. If a measurement with the same name is already running, it will be replaced
|
|
23
|
+
* @param options additional details related to the measurement
|
|
24
24
|
* @returns a promise that resolves to a PerformanceMeasure object
|
|
25
25
|
*/
|
|
26
|
-
|
|
26
|
+
startTiming: (name: string, options: TimingOptions) => Promise<PerformanceMark>;
|
|
27
27
|
/**
|
|
28
|
-
* end
|
|
29
|
-
* @param
|
|
30
|
-
* @param
|
|
31
|
-
* @returns a promise that resolves when the
|
|
28
|
+
* end timing measure
|
|
29
|
+
* @param start name used to start timing measure or return value of the startTiming method
|
|
30
|
+
* @param options additional details related to the measurement
|
|
31
|
+
* @returns a promise that resolves when the timing measurement is ended
|
|
32
32
|
* @example
|
|
33
33
|
* ```typescript
|
|
34
|
-
* const
|
|
34
|
+
* const longTaskMeasurement = await analytics.startTiming('LongTask', { appId: 'myApp', appUrl: 'https://myapp.com' });
|
|
35
35
|
* // do some work
|
|
36
|
-
* await analytics.
|
|
36
|
+
* await analytics.endTiming(longTaskMeasurement, { appId: 'myApp', appUrl: 'https://myapp.com' });
|
|
37
37
|
* ```
|
|
38
38
|
* ```typescript
|
|
39
|
-
* await analytics.
|
|
39
|
+
* const longTaskMeasurement = await analytics.startTiming('LongTask', { appId: 'myApp', appUrl: 'https://myapp.com' });
|
|
40
40
|
* // do some work
|
|
41
|
-
* await analytics.
|
|
41
|
+
* await analytics.endTiming('LongTask', { appId: 'loanApp', appUrl: 'https://loanApp.com' });
|
|
42
42
|
* ```
|
|
43
43
|
*/
|
|
44
|
-
|
|
44
|
+
endTiming: (start: string | PerformanceMeasure, options: TimingOptions) => Promise<void>;
|
|
45
45
|
}
|