@equinor/mad-insights 0.1.4 → 0.2.0

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 CHANGED
@@ -1,39 +1,51 @@
1
1
  # @equinor/mad-insights
2
2
 
3
+ ## 0.2.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 7bf5e2b: React Native Architecture Upgrade -> Expo sdk upgraded to version 53
8
+
9
+ ## 0.1.5
10
+
11
+ ### Patch Changes
12
+
13
+ - b78671d: Changed peer dependencies requirement range to now allow patch changes.
14
+
3
15
  ## 0.1.4
4
16
 
5
17
  ### Patch Changes
6
18
 
7
- - fc6505c: Add Replace step for all "workspace:\*" dependencies
19
+ - fc6505c: Add Replace step for all "workspace:\*" dependencies
8
20
 
9
21
  ## 0.1.3
10
22
 
11
23
  ### Patch Changes
12
24
 
13
- - 6349528: `addTelemetryInitializer`: should no longer crash if long term log is not initialized
25
+ - 6349528: `addTelemetryInitializer`: should no longer crash if long term log is not initialized
14
26
 
15
27
  ## 0.1.2
16
28
 
17
29
  ### Patch Changes
18
30
 
19
- - b2b8572: feat: should now be possible to run `track` before app insights is initialized
31
+ - b2b8572: feat: should now be possible to run `track` before app insights is initialized
20
32
 
21
33
  ## 0.1.1
22
34
 
23
35
  ### Patch Changes
24
36
 
25
- - b025c9b: Implemented Create Incident Screen
37
+ - b025c9b: Implemented Create Incident Screen
26
38
 
27
39
  ## 0.1.0
28
40
 
29
41
  ### Minor Changes
30
42
 
31
- - 936e5e0: Added the ability to use `addTelemetryInitializer` before initializing application
32
- insights
43
+ - 936e5e0: Added the ability to use `addTelemetryInitializer` before initializing application
44
+ insights
33
45
 
34
46
  ## 0.0.2
35
47
 
36
48
  ### Patch Changes
37
49
 
38
- - 25ef39f: first version of mad insights, added a navigation container to mad-navigation
39
- - 25ef39f: mad-insights initial commit
50
+ - 25ef39f: first version of mad insights, added a navigation container to mad-navigation
51
+ - 25ef39f: mad-insights initial commit
@@ -1,49 +1,44 @@
1
1
  # How we work
2
2
 
3
- In Equinor, [how we deliver is as important as what we
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
- and applies to all community members and participants in any Equinor maintained
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
- how we live up to our
14
- [values](https://www.equinor.com/en/about-us.html#our-values). Equally, we also
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
- responsible creating an environment for proper handling of issues raised within
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
- to call out for assistance. Getting an outsiders perspective on the topic might
26
- be just what is needed for you to proceed.
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
- email will be handled by a team within the Equinor organization.
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
- unless you chose to disclose it yourself.
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
- conflicts with our values or threatens our reputation.
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
- external third parties interacting with us to raise concerns or report any
41
- suspected or potential breaches of law or company policies.
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
- behaviour regulated, and handled within the open source code of conduct, or you
45
- wish to place an anonymous, confidential report we encourage to use the [Equinor
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-GCHDCY5M.js";
4
- import "./chunk-VNYFCEDH.js";
5
- import "./chunk-ZP5UXSLZ.js";
6
- import "./chunk-Q2JGSIYU.js";
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
  };
@@ -16,8 +16,8 @@ import {
16
16
  trackNavigation,
17
17
  trackShortTerm,
18
18
  validateAppInsightsInit
19
- } from "./chunk-ZP5UXSLZ.js";
20
- import "./chunk-Q2JGSIYU.js";
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-Q2JGSIYU.js";
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,6 +1,6 @@
1
1
  import {
2
2
  useAppInsights
3
- } from "./chunk-VNYFCEDH.js";
3
+ } from "./chunk-YOM52B44.js";
4
4
 
5
5
  // src/AppInsightsInitializer.ts
6
6
  var AppInsightsInitializer = ({ children, config }) => {
@@ -1,14 +1,13 @@
1
1
  import {
2
2
  appInsightsHasBeenInitialized,
3
3
  appInsightsInit
4
- } from "./chunk-ZP5UXSLZ.js";
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
- domain = "no domain";
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
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  obfuscateUser
3
- } from "./chunk-Q2JGSIYU.js";
3
+ } from "./chunk-YSLSGXQP.js";
4
4
  export {
5
5
  obfuscateUser
6
6
  };
package/dist/index.js CHANGED
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  AppInsightsInitializer
3
- } from "./chunk-GCHDCY5M.js";
3
+ } from "./chunk-ESHZZFTG.js";
4
4
  import "./chunk-6F4PWJZI.js";
5
5
  import {
6
6
  useAppInsights
7
- } from "./chunk-VNYFCEDH.js";
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-ZP5UXSLZ.js";
27
- import "./chunk-Q2JGSIYU.js";
26
+ } from "./chunk-7IKLEQVH.js";
27
+ import "./chunk-YSLSGXQP.js";
28
28
  export {
29
29
  AppInsightsInitializer,
30
30
  addTelemetryInitializer,
@@ -1 +1,2 @@
1
- export declare const useAppInsights: (config: import("./types").AppInsightsInitConfig) => void;
1
+ import { appInsightsInit } from "./appInsights";
2
+ export declare const useAppInsights: (...args: Parameters<typeof appInsightsInit>) => void;
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  useAppInsights
3
- } from "./chunk-VNYFCEDH.js";
4
- import "./chunk-ZP5UXSLZ.js";
5
- import "./chunk-Q2JGSIYU.js";
3
+ } from "./chunk-YOM52B44.js";
4
+ import "./chunk-7IKLEQVH.js";
5
+ import "./chunk-YSLSGXQP.js";
6
6
  export {
7
7
  useAppInsights
8
8
  };
package/package.json CHANGED
@@ -1,37 +1,11 @@
1
1
  {
2
2
  "name": "@equinor/mad-insights",
3
- "version": "0.1.4",
4
3
  "description": "Application Insights implementation for the mad team",
5
- "type": "module",
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 dist .turbo"
12
- },
13
- "keywords": [
14
- "react native",
15
- "tracking",
16
- "logging",
17
- "typescript"
18
- ],
4
+ "version": "0.2.0",
19
5
  "author": {
20
6
  "name": "Equinor Mobile App Delivery team (MAD)"
21
7
  },
22
- "license": "MIT",
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.9.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
- "@types/crypto-js": "^4.1.2"
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
- ]
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": "19.0.0",
40
+ "react-dom": "19.0.0",
41
+ "react-native": "~0.79.5",
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"
52
53
  }