@equinor/mad-insights 0.1.3 → 0.1.5
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 +19 -7
- package/CODE_OF_CONDUCT.md +25 -30
- package/dist/AppInsightsInitializer.js +4 -4
- package/dist/appInsights.js +2 -2
- package/dist/{chunk-ZP5UXSLZ.js → chunk-7IKLEQVH.js} +4 -7
- package/dist/{chunk-GCHDCY5M.js → chunk-ESHZZFTG.js} +1 -1
- package/dist/{chunk-VNYFCEDH.js → chunk-YOM52B44.js} +2 -3
- package/dist/{chunk-Q2JGSIYU.js → chunk-YSLSGXQP.js} +2 -4
- package/dist/encrypt.js +1 -1
- package/dist/index.js +4 -4
- package/dist/useAppInsights.js +3 -3
- package/package.json +32 -31
package/CHANGELOG.md
CHANGED
|
@@ -1,33 +1,45 @@
|
|
|
1
1
|
# @equinor/mad-insights
|
|
2
2
|
|
|
3
|
+
## 0.1.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- b78671d: Changed peer dependencies requirement range to now allow patch changes.
|
|
8
|
+
|
|
9
|
+
## 0.1.4
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- fc6505c: Add Replace step for all "workspace:\*" dependencies
|
|
14
|
+
|
|
3
15
|
## 0.1.3
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
|
6
18
|
|
|
7
|
-
-
|
|
19
|
+
- 6349528: `addTelemetryInitializer`: should no longer crash if long term log is not initialized
|
|
8
20
|
|
|
9
21
|
## 0.1.2
|
|
10
22
|
|
|
11
23
|
### Patch Changes
|
|
12
24
|
|
|
13
|
-
-
|
|
25
|
+
- b2b8572: feat: should now be possible to run `track` before app insights is initialized
|
|
14
26
|
|
|
15
27
|
## 0.1.1
|
|
16
28
|
|
|
17
29
|
### Patch Changes
|
|
18
30
|
|
|
19
|
-
-
|
|
31
|
+
- b025c9b: Implemented Create Incident Screen
|
|
20
32
|
|
|
21
33
|
## 0.1.0
|
|
22
34
|
|
|
23
35
|
### Minor Changes
|
|
24
36
|
|
|
25
|
-
-
|
|
26
|
-
|
|
37
|
+
- 936e5e0: Added the ability to use `addTelemetryInitializer` before initializing application
|
|
38
|
+
insights
|
|
27
39
|
|
|
28
40
|
## 0.0.2
|
|
29
41
|
|
|
30
42
|
### Patch Changes
|
|
31
43
|
|
|
32
|
-
-
|
|
33
|
-
-
|
|
44
|
+
- 25ef39f: first version of mad insights, added a navigation container to mad-navigation
|
|
45
|
+
- 25ef39f: mad-insights initial commit
|
package/CODE_OF_CONDUCT.md
CHANGED
|
@@ -1,49 +1,44 @@
|
|
|
1
1
|
# How we work
|
|
2
2
|
|
|
3
|
-
In Equinor,
|
|
4
|
-
deliver](https://www.equinor.com/en/careers/our-culture.html).
|
|
3
|
+
In Equinor,
|
|
4
|
+
[how we deliver is as important as what we deliver](https://www.equinor.com/en/careers/our-culture.html).
|
|
5
5
|
|
|
6
|
-
This set the expectations for how we collaborate in our open source projects,
|
|
7
|
-
|
|
8
|
-
project.
|
|
6
|
+
This set the expectations for how we collaborate in our open source projects, and applies to all
|
|
7
|
+
community members and participants in any Equinor maintained project.
|
|
9
8
|
|
|
10
9
|
## Handling issues within the communities
|
|
11
10
|
|
|
12
|
-
We expect all to have a low threshold for raising issues, or in general discuss
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
encourage all community members to appreciate when concerns are raised, and make
|
|
16
|
-
its best effort in solving them.
|
|
11
|
+
We expect all to have a low threshold for raising issues, or in general discuss how we live up to
|
|
12
|
+
our [values](https://www.equinor.com/en/about-us.html#our-values). Equally, we also encourage all
|
|
13
|
+
community members to appreciate when concerns are raised, and make its best effort in solving them.
|
|
17
14
|
|
|
18
|
-
As well as responsibility for what is delivered the project maintainers are also
|
|
19
|
-
|
|
20
|
-
the communities.
|
|
15
|
+
As well as responsibility for what is delivered the project maintainers are also responsible
|
|
16
|
+
creating an environment for proper handling of issues raised within the communities.
|
|
21
17
|
|
|
22
18
|
## Call out for assistance
|
|
23
19
|
|
|
24
|
-
For any problem not directly resolvable within the community, we encourage you
|
|
25
|
-
|
|
26
|
-
|
|
20
|
+
For any problem not directly resolvable within the community, we encourage you to call out for
|
|
21
|
+
assistance. Getting an outsiders perspective on the topic might be just what is needed for you to
|
|
22
|
+
proceed.
|
|
27
23
|
|
|
28
|
-
Send an e-mail to opensource_at_equinor.com and invite for a discussion. The
|
|
29
|
-
|
|
24
|
+
Send an e-mail to opensource_at_equinor.com and invite for a discussion. The email will be handled
|
|
25
|
+
by a team within the Equinor organization.
|
|
30
26
|
|
|
31
|
-
Your request will be kept confidential from the team or community in question,
|
|
32
|
-
|
|
27
|
+
Your request will be kept confidential from the team or community in question, unless you chose to
|
|
28
|
+
disclose it yourself.
|
|
33
29
|
|
|
34
30
|
## Ethics helpline
|
|
35
31
|
|
|
36
|
-
In Equinor, we want you to speak up whenever you see unethical behaviour that
|
|
37
|
-
|
|
32
|
+
In Equinor, we want you to speak up whenever you see unethical behaviour that conflicts with our
|
|
33
|
+
values or threatens our reputation.
|
|
38
34
|
|
|
39
|
-
To underline this, we continuously encourage and remind our employees and any
|
|
40
|
-
|
|
41
|
-
|
|
35
|
+
To underline this, we continuously encourage and remind our employees and any external third parties
|
|
36
|
+
interacting with us to raise concerns or report any suspected or potential breaches of law or
|
|
37
|
+
company policies.
|
|
42
38
|
|
|
43
|
-
For any questions or issues that one suspect falls outside the scope of
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
Ethics
|
|
47
|
-
helpline](https://secure.ethicspoint.eu/domain/media/en/gui/102166/index.html).
|
|
39
|
+
For any questions or issues that one suspect falls outside the scope of behaviour regulated, and
|
|
40
|
+
handled within the open source code of conduct, or you wish to place an anonymous, confidential
|
|
41
|
+
report we encourage to use the
|
|
42
|
+
[Equinor Ethics helpline](https://secure.ethicspoint.eu/domain/media/en/gui/102166/index.html).
|
|
48
43
|
|
|
49
44
|
This helpline is hosted by a third party helpline provider.
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
AppInsightsInitializer
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-ESHZZFTG.js";
|
|
4
|
+
import "./chunk-YOM52B44.js";
|
|
5
|
+
import "./chunk-7IKLEQVH.js";
|
|
6
|
+
import "./chunk-YSLSGXQP.js";
|
|
7
7
|
export {
|
|
8
8
|
AppInsightsInitializer
|
|
9
9
|
};
|
package/dist/appInsights.js
CHANGED
|
@@ -16,8 +16,8 @@ import {
|
|
|
16
16
|
trackNavigation,
|
|
17
17
|
trackShortTerm,
|
|
18
18
|
validateAppInsightsInit
|
|
19
|
-
} from "./chunk-
|
|
20
|
-
import "./chunk-
|
|
19
|
+
} from "./chunk-7IKLEQVH.js";
|
|
20
|
+
import "./chunk-YSLSGXQP.js";
|
|
21
21
|
export {
|
|
22
22
|
addTelemetryInitializer,
|
|
23
23
|
appInsightsHasBeenInitialized,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
obfuscateUser
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-YSLSGXQP.js";
|
|
4
4
|
|
|
5
5
|
// src/appInsights.ts
|
|
6
6
|
import { ReactPlugin } from "@microsoft/applicationinsights-react-js";
|
|
@@ -22,8 +22,7 @@ var appInsightsInit = (config) => {
|
|
|
22
22
|
var _a, _b;
|
|
23
23
|
const { connectionString, instrumentationKey } = config;
|
|
24
24
|
useSHA1 = (_b = (_a = config.longTermLog) == null ? void 0 : _a.useSHA1) != null ? _b : false;
|
|
25
|
-
if (hasBeenInitialized)
|
|
26
|
-
return;
|
|
25
|
+
if (hasBeenInitialized) return;
|
|
27
26
|
hasBeenInitialized = true;
|
|
28
27
|
if (Platform.OS === "web") {
|
|
29
28
|
const browserHistory = createBrowserHistory();
|
|
@@ -119,8 +118,7 @@ var trackEventLongTerm = (event, customProperties) => {
|
|
|
119
118
|
};
|
|
120
119
|
var track = (eventName, eventStatus, extraText, extraData) => {
|
|
121
120
|
const eventString = `${eventName} ${eventStatus != null ? eventStatus : ""}. ${extraText != null ? extraText : ""}`;
|
|
122
|
-
if (excludeLogFilter(eventString, ["Ping", "ServiceMessage"]))
|
|
123
|
-
return;
|
|
121
|
+
if (excludeLogFilter(eventString, ["Ping", "ServiceMessage"])) return;
|
|
124
122
|
trackEvent({ name: eventString }, extraData);
|
|
125
123
|
if (appInsightsLongTermLog) {
|
|
126
124
|
trackEventLongTerm({ name: eventString }, extraData);
|
|
@@ -145,8 +143,7 @@ var trackLongTerm = (eventName, eventStatus, extraText, extraData) => {
|
|
|
145
143
|
};
|
|
146
144
|
var trackNavigation = (routeName, longTerm) => {
|
|
147
145
|
track("NAVIGATE" /* NAVIGATE */, void 0, routeName);
|
|
148
|
-
if (longTerm)
|
|
149
|
-
trackLongTerm("NAVIGATE" /* NAVIGATE */, void 0, routeName);
|
|
146
|
+
if (longTerm) trackLongTerm("NAVIGATE" /* NAVIGATE */, void 0, routeName);
|
|
150
147
|
};
|
|
151
148
|
var trackCustom = (text, extraData) => {
|
|
152
149
|
track("CUSTOM" /* CUSTOM */, void 0, text, extraData);
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
appInsightsHasBeenInitialized,
|
|
3
3
|
appInsightsInit
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-7IKLEQVH.js";
|
|
5
5
|
|
|
6
6
|
// src/useAppInsights.ts
|
|
7
7
|
import { useEffect } from "react";
|
|
8
8
|
var useAppInsights = (...args) => {
|
|
9
9
|
useEffect(() => {
|
|
10
|
-
if (appInsightsHasBeenInitialized())
|
|
11
|
-
return;
|
|
10
|
+
if (appInsightsHasBeenInitialized()) return;
|
|
12
11
|
appInsightsInit(...args);
|
|
13
12
|
}, [args]);
|
|
14
13
|
};
|
|
@@ -2,10 +2,8 @@
|
|
|
2
2
|
import CryptoJS from "crypto-js";
|
|
3
3
|
function obfuscateUser(username, userIdentifier, useSHA1) {
|
|
4
4
|
let domain;
|
|
5
|
-
if (username.includes("@") === false)
|
|
6
|
-
|
|
7
|
-
else
|
|
8
|
-
domain = username.split("@")[1].toLowerCase();
|
|
5
|
+
if (username.includes("@") === false) domain = "no domain";
|
|
6
|
+
else domain = username.split("@")[1].toLowerCase();
|
|
9
7
|
const stringToEncrypt = `${userIdentifier}`;
|
|
10
8
|
const hash = useSHA1 ? CryptoJS.SHA1(stringToEncrypt) : CryptoJS.SHA256(stringToEncrypt);
|
|
11
9
|
return { id: hash.toString(), domain };
|
package/dist/encrypt.js
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
AppInsightsInitializer
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-ESHZZFTG.js";
|
|
4
4
|
import "./chunk-6F4PWJZI.js";
|
|
5
5
|
import {
|
|
6
6
|
useAppInsights
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-YOM52B44.js";
|
|
8
8
|
import {
|
|
9
9
|
addTelemetryInitializer,
|
|
10
10
|
appInsightsHasBeenInitialized,
|
|
@@ -23,8 +23,8 @@ import {
|
|
|
23
23
|
trackNavigation,
|
|
24
24
|
trackShortTerm,
|
|
25
25
|
validateAppInsightsInit
|
|
26
|
-
} from "./chunk-
|
|
27
|
-
import "./chunk-
|
|
26
|
+
} from "./chunk-7IKLEQVH.js";
|
|
27
|
+
import "./chunk-YSLSGXQP.js";
|
|
28
28
|
export {
|
|
29
29
|
AppInsightsInitializer,
|
|
30
30
|
addTelemetryInitializer,
|
package/dist/useAppInsights.js
CHANGED
package/package.json
CHANGED
|
@@ -1,37 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@equinor/mad-insights",
|
|
3
|
-
"version": "0.1.3",
|
|
4
3
|
"description": "Application Insights implementation for the mad team",
|
|
5
|
-
"
|
|
6
|
-
"scripts": {
|
|
7
|
-
"build": "tsup-node && echo '\n ⚙️ Generating typescript declarations..' && tsc --project tsconfig.json --emitDeclarationOnly --declaration",
|
|
8
|
-
"test": "node --experimental-vm-modules ../../node_modules/jest/bin/jest.js",
|
|
9
|
-
"dev": "tsup-node --watch --clean=false",
|
|
10
|
-
"lint": "eslint src/",
|
|
11
|
-
"clean": "rm -rf node_modules/ && rm -rf dist/"
|
|
12
|
-
},
|
|
13
|
-
"keywords": [
|
|
14
|
-
"react native",
|
|
15
|
-
"tracking",
|
|
16
|
-
"logging",
|
|
17
|
-
"typescript"
|
|
18
|
-
],
|
|
4
|
+
"version": "0.1.5",
|
|
19
5
|
"author": {
|
|
20
6
|
"name": "Equinor Mobile App Delivery team (MAD)"
|
|
21
7
|
},
|
|
22
|
-
"
|
|
23
|
-
"bugs": {
|
|
24
|
-
"url": "https://github.com/equinor/mad/issues"
|
|
25
|
-
},
|
|
26
|
-
"homepage": "https://github.com/equinor/mad/",
|
|
27
|
-
"main": "./dist/index.js",
|
|
28
|
-
"types": "./dist/index.d.ts",
|
|
29
|
-
"peerDependencies": {
|
|
30
|
-
"react": ">=18.0",
|
|
31
|
-
"react-dom": ">=18.0",
|
|
32
|
-
"react-native": ">=0.70",
|
|
33
|
-
"react-native-device-info": "^10.8.0"
|
|
34
|
-
},
|
|
8
|
+
"bugs": "https://github.com/equinor/mad/issues",
|
|
35
9
|
"dependencies": {
|
|
36
10
|
"@microsoft/applicationinsights-react-js": "^17.0.0",
|
|
37
11
|
"@microsoft/applicationinsights-react-native": "^4.0.2",
|
|
@@ -41,12 +15,39 @@
|
|
|
41
15
|
},
|
|
42
16
|
"devDependencies": {
|
|
43
17
|
"@equinor/eslint-config-mad": "*",
|
|
44
|
-
"@
|
|
18
|
+
"@equinor/mad-tsconfig": "*",
|
|
19
|
+
"@types/crypto-js": "^4.1.2",
|
|
20
|
+
"eslint": "^8.46.0",
|
|
21
|
+
"tsup": "^8.3.5"
|
|
45
22
|
},
|
|
46
23
|
"files": [
|
|
47
24
|
"CODE_OF_CONDUCT.md",
|
|
48
25
|
"LICENSE",
|
|
49
26
|
"CHANGELOG.md",
|
|
50
27
|
"dist"
|
|
51
|
-
]
|
|
52
|
-
|
|
28
|
+
],
|
|
29
|
+
"homepage": "https://github.com/equinor/mad/",
|
|
30
|
+
"keywords": [
|
|
31
|
+
"logging",
|
|
32
|
+
"react native",
|
|
33
|
+
"tracking",
|
|
34
|
+
"typescript"
|
|
35
|
+
],
|
|
36
|
+
"license": "MIT",
|
|
37
|
+
"main": "./dist/index.js",
|
|
38
|
+
"peerDependencies": {
|
|
39
|
+
"react": "~18.3.1",
|
|
40
|
+
"react-dom": "~18.3.1",
|
|
41
|
+
"react-native": "~0.76.3",
|
|
42
|
+
"react-native-device-info": "^10.9.0"
|
|
43
|
+
},
|
|
44
|
+
"scripts": {
|
|
45
|
+
"build": "tsup-node && echo '\n ⚙️ Generating typescript declarations..' && tsc --project tsconfig.json --emitDeclarationOnly --declaration",
|
|
46
|
+
"clean": "rm -rf node_modules dist .turbo",
|
|
47
|
+
"dev": "tsup-node --watch --clean=false",
|
|
48
|
+
"lint": "eslint src/",
|
|
49
|
+
"test": "node --experimental-vm-modules ../../node_modules/jest/bin/jest.js"
|
|
50
|
+
},
|
|
51
|
+
"type": "module",
|
|
52
|
+
"types": "./dist/index.d.ts"
|
|
53
|
+
}
|