@trackunit/react-core-contexts 0.4.165 → 0.4.166
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/index.cjs +14 -8
- package/index.js +11 -8
- package/package.json +2 -1
package/index.cjs
CHANGED
|
@@ -8,6 +8,7 @@ var context = require('@apollo/client/link/context');
|
|
|
8
8
|
var error = require('@apollo/client/link/error');
|
|
9
9
|
var Sentry = require('@sentry/browser');
|
|
10
10
|
var reactCoreHooks = require('@trackunit/react-core-hooks');
|
|
11
|
+
var amplitude = require('amplitude-js');
|
|
11
12
|
var apolloUploadClient = require('apollo-upload-client');
|
|
12
13
|
var React = require('react');
|
|
13
14
|
var irisAppRuntimeCore = require('@trackunit/iris-app-runtime-core');
|
|
@@ -16,6 +17,8 @@ var i18nLibraryTranslation = require('@trackunit/i18n-library-translation');
|
|
|
16
17
|
var reactComponents = require('@trackunit/react-components');
|
|
17
18
|
var reactRouterDom = require('react-router-dom');
|
|
18
19
|
|
|
20
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
21
|
+
|
|
19
22
|
function _interopNamespace(e) {
|
|
20
23
|
if (e && e.__esModule) return e;
|
|
21
24
|
var n = Object.create(null);
|
|
@@ -35,6 +38,7 @@ function _interopNamespace(e) {
|
|
|
35
38
|
}
|
|
36
39
|
|
|
37
40
|
var Sentry__namespace = /*#__PURE__*/_interopNamespace(Sentry);
|
|
41
|
+
var amplitude__default = /*#__PURE__*/_interopDefaultLegacy(amplitude);
|
|
38
42
|
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
39
43
|
|
|
40
44
|
/******************************************************************************
|
|
@@ -119,14 +123,16 @@ const createApolloClient = ({ graphqlManagerUrl, graphqlPublicUrl, graphqlManage
|
|
|
119
123
|
((_c = x === null || x === void 0 ? void 0 : x.message) === null || _c === void 0 ? void 0 : _c.includes("Access denied! You need to be authorized to perform this action!")));
|
|
120
124
|
});
|
|
121
125
|
if (invalidToken) {
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
126
|
+
amplitude__default["default"].getInstance().logEvent("ManagerApolloProviderError", errorResponse.graphQLErrors);
|
|
127
|
+
//Temp fix for Sentry overload
|
|
128
|
+
// Sentry.captureException({
|
|
129
|
+
// category: "GraphQL",
|
|
130
|
+
// message: "GraphQL Error - invalidToken",
|
|
131
|
+
// level: "warning",
|
|
132
|
+
// data: {
|
|
133
|
+
// log: JSON.stringify(errorResponse.graphQLErrors),
|
|
134
|
+
// },
|
|
135
|
+
// });
|
|
130
136
|
}
|
|
131
137
|
}
|
|
132
138
|
if (errorResponse.networkError) {
|
package/index.js
CHANGED
|
@@ -4,6 +4,7 @@ import { setContext } from '@apollo/client/link/context';
|
|
|
4
4
|
import { onError } from '@apollo/client/link/error';
|
|
5
5
|
import * as Sentry from '@sentry/browser';
|
|
6
6
|
import { useEnvironment, useCurrentUser, useToken, ToastProvider, AnalyticsContextProvider, AssetSortingProvider, EnvironmentContextProvider, GlobalSelectionProvider, OemBrandingContextProvider as OemBrandingContextProvider$1, TokenProvider, CurrentUserProvider, UserSubscriptionProvider as UserSubscriptionProvider$1, useURLSynchronization } from '@trackunit/react-core-hooks';
|
|
7
|
+
import amplitude from 'amplitude-js';
|
|
7
8
|
import { createUploadLink } from 'apollo-upload-client';
|
|
8
9
|
import * as React from 'react';
|
|
9
10
|
import { useMemo, useEffect, useState } from 'react';
|
|
@@ -95,14 +96,16 @@ const createApolloClient = ({ graphqlManagerUrl, graphqlPublicUrl, graphqlManage
|
|
|
95
96
|
((_c = x === null || x === void 0 ? void 0 : x.message) === null || _c === void 0 ? void 0 : _c.includes("Access denied! You need to be authorized to perform this action!")));
|
|
96
97
|
});
|
|
97
98
|
if (invalidToken) {
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
99
|
+
amplitude.getInstance().logEvent("ManagerApolloProviderError", errorResponse.graphQLErrors);
|
|
100
|
+
//Temp fix for Sentry overload
|
|
101
|
+
// Sentry.captureException({
|
|
102
|
+
// category: "GraphQL",
|
|
103
|
+
// message: "GraphQL Error - invalidToken",
|
|
104
|
+
// level: "warning",
|
|
105
|
+
// data: {
|
|
106
|
+
// log: JSON.stringify(errorResponse.graphQLErrors),
|
|
107
|
+
// },
|
|
108
|
+
// });
|
|
106
109
|
}
|
|
107
110
|
}
|
|
108
111
|
if (errorResponse.networkError) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trackunit/react-core-contexts",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.166",
|
|
4
4
|
"repository": "https://github.com/Trackunit/manager",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"dependencies": {
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
"@trackunit/react-core-contexts-api": "0.2.37",
|
|
15
15
|
"@trackunit/react-core-contexts-test": "0.1.69",
|
|
16
16
|
"@trackunit/react-core-hooks": "0.2.60",
|
|
17
|
+
"amplitude-js": "7.4.4",
|
|
17
18
|
"apollo-upload-client": "17.0.0",
|
|
18
19
|
"react": "18.2.0",
|
|
19
20
|
"react-router-dom": "6.4.5"
|