@equinor/mad-insights 0.1.0 → 0.1.2
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/CHANGELOG.md +12 -0
- package/dist/AppInsightsInitializer.js +3 -3
- package/dist/appInsights.js +1 -1
- package/dist/{chunk-UBOLTVAF.js → chunk-BFIJGTYR.js} +12 -3
- package/dist/{chunk-UEUCDD3L.js → chunk-BWK4IRL4.js} +1 -1
- package/dist/{chunk-A36VBZRX.js → chunk-G4C2PBQE.js} +1 -1
- package/dist/index.js +3 -3
- package/dist/types.d.ts +5 -1
- package/dist/useAppInsights.js +2 -2
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @equinor/mad-insights
|
|
2
2
|
|
|
3
|
+
## 0.1.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- b2b8572: feat: should now be possible to run `track` before app insights is initialized
|
|
8
|
+
|
|
9
|
+
## 0.1.1
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- b025c9b: Implemented Create Incident Screen
|
|
14
|
+
|
|
3
15
|
## 0.1.0
|
|
4
16
|
|
|
5
17
|
### Minor Changes
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
AppInsightsInitializer
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-BWK4IRL4.js";
|
|
4
|
+
import "./chunk-G4C2PBQE.js";
|
|
5
|
+
import "./chunk-BFIJGTYR.js";
|
|
6
6
|
import "./chunk-Q2JGSIYU.js";
|
|
7
7
|
export {
|
|
8
8
|
AppInsightsInitializer
|
package/dist/appInsights.js
CHANGED
|
@@ -16,6 +16,8 @@ var hasBeenInitialized = false;
|
|
|
16
16
|
var reactPluginWeb;
|
|
17
17
|
var useSHA1;
|
|
18
18
|
var envelopeBacklog = [];
|
|
19
|
+
var trackShortTermBacklog = [];
|
|
20
|
+
var trackLongTermBacklog = [];
|
|
19
21
|
var appInsightsInit = (config) => {
|
|
20
22
|
var _a, _b;
|
|
21
23
|
const { connectionString, instrumentationKey } = config;
|
|
@@ -76,6 +78,8 @@ var appInsightsInit = (config) => {
|
|
|
76
78
|
appInsightsMain.loadAppInsights();
|
|
77
79
|
}
|
|
78
80
|
envelopeBacklog.forEach(addTelemetryInitializer);
|
|
81
|
+
trackShortTermBacklog.forEach((item) => trackEvent(item.event, item.customProperties));
|
|
82
|
+
trackLongTermBacklog.forEach((item) => trackEventLongTerm(item.event, item.customProperties));
|
|
79
83
|
void track("Application STARTED" /* APP_STARTED */);
|
|
80
84
|
};
|
|
81
85
|
var appInsightsHasBeenInitialized = () => hasBeenInitialized;
|
|
@@ -100,12 +104,17 @@ var setUsername = (username, userIdentifier) => {
|
|
|
100
104
|
}
|
|
101
105
|
};
|
|
102
106
|
var trackEvent = (event, customProperties) => {
|
|
103
|
-
|
|
107
|
+
if (!appInsightsMain) {
|
|
108
|
+
trackShortTermBacklog.push({ event, customProperties });
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
104
111
|
appInsightsMain.trackEvent(event, customProperties);
|
|
105
112
|
};
|
|
106
113
|
var trackEventLongTerm = (event, customProperties) => {
|
|
107
|
-
if (!appInsightsLongTermLog)
|
|
108
|
-
|
|
114
|
+
if (!appInsightsLongTermLog) {
|
|
115
|
+
trackLongTermBacklog.push({ event, customProperties });
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
109
118
|
appInsightsLongTermLog.trackEvent(event, customProperties);
|
|
110
119
|
};
|
|
111
120
|
var track = (eventName, eventStatus, extraText, extraData) => {
|
package/dist/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
AppInsightsInitializer
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-BWK4IRL4.js";
|
|
4
4
|
import "./chunk-6F4PWJZI.js";
|
|
5
5
|
import {
|
|
6
6
|
useAppInsights
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-G4C2PBQE.js";
|
|
8
8
|
import {
|
|
9
9
|
addTelemetryInitializer,
|
|
10
10
|
appInsightsHasBeenInitialized,
|
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
trackNavigation,
|
|
24
24
|
trackShortTerm,
|
|
25
25
|
validateAppInsightsInit
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-BFIJGTYR.js";
|
|
27
27
|
import "./chunk-Q2JGSIYU.js";
|
|
28
28
|
export {
|
|
29
29
|
AppInsightsInitializer,
|
package/dist/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ITelemetryItem } from "@microsoft/applicationinsights-web";
|
|
1
|
+
import { ICustomProperties, IEventTelemetry, ITelemetryItem } from "@microsoft/applicationinsights-web";
|
|
2
2
|
export type AppInsightsInitConfig = ({
|
|
3
3
|
connectionString: string;
|
|
4
4
|
instrumentationKey?: undefined;
|
|
@@ -21,3 +21,7 @@ export type AppInsightsInitConfig = ({
|
|
|
21
21
|
};
|
|
22
22
|
};
|
|
23
23
|
export type Envelope = (item: ITelemetryItem) => boolean | void;
|
|
24
|
+
export type TrackEventPayload = {
|
|
25
|
+
event: IEventTelemetry;
|
|
26
|
+
customProperties?: ICustomProperties | undefined;
|
|
27
|
+
};
|
package/dist/useAppInsights.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@equinor/mad-insights",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "Application Insights implementation for the mad team",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"keywords": [
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"@types/crypto-js": "^4.1.2",
|
|
37
|
-
"@equinor/eslint-config-mad": "0.3.
|
|
37
|
+
"@equinor/eslint-config-mad": "0.3.1"
|
|
38
38
|
},
|
|
39
39
|
"files": [
|
|
40
40
|
"CODE_OF_CONDUCT.md",
|