Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}
if (validationFails.length > 0) {
validationFails.forEach(function(validationFail) {
var div = document.createElement('div');
div.style.marginBottom = '6px';
div.innerHTML = validationFail;
validationBar.appendChild(div);
});
document.body && document.body.appendChild(validationBar);
}
})();
}
// Raven
Raven.config('https://f756b8d4b492473782987a054aa9a347@sentry.io/133634', {
shouldSendCallback(data) {
const oldSafari = /^.*Version\/[0-8].*Safari.*$/;
const bingPreview = /^.*BingPreview.*$/;
return ![oldSafari, bingPreview].some(r =>
r.test(window.navigator.userAgent)
);
},
whitelistUrls: [/wellcomecollection\.org/],
ignoreErrors: [
/Blocked a frame with origin/,
/document\.getElementsByClassName\.ToString/, // https://github.com/SamsungInternet/support/issues/56
],
}).install();
}
import upperFirst from "lodash/upperFirst"
import camelCase from "lodash/camelCase"
import axios from "axios"
import Raven from "raven-js"
import RavenVue from "raven-js/plugins/vue"
// import { Chrome } from "vue-color"
// Vue.component("colorselector", Chrome)
Array.prototype.last = function() {
return this[this.length - 1]
}
if (process.env.NODE_ENV !== "development")
Raven.config("https://dc7c9a8085d64d6d9181158bc19e3236@sentry.io/1323916")
.addPlugin(RavenVue, Vue)
.install()
const resolveUrl = (url, payload) => {
return {
object: "message",
path: url,
data: payload,
}
}
const requireComponent = require.context("./components", true, /\w+\.(vue)$/)
requireComponent.keys().forEach(fileName => {
const componentConfig = requireComponent(fileName)
const componentName = upperFirst(
import { APP_ROUTES } from '@app/app-routes';
import { AppComponent } from '@app/app.component';
import * as helper from '@app/helper/_index';
import { MyCovalentModule } from '@app/modules/my-covalent.module';
import { MyMaterialModule } from '@app/modules/my-material.module';
import { SharedModule } from '@app/modules/shared.module';
import { SpaceModule } from '@app/modules/space.module';
import { ValidationMsgModule } from '@app/modules/validation-msg.module';
import { environment } from '@env/environment';
// let options2 = { 'release': 'a2.1.0', 'autoBreadcrumbs': { 'xhr': false } };
// Raven
// .config('https://dce19ce2043947e4943a09a2255336d8@sentry.io/121453', options2)
// .install();
if (environment.canUseRaven === true) {
Raven.config(
'https://3f5855e2b10b4c4c8b786ff69c1fe3a6@sentry.io/1208233'
).install();
}
@NgModule({
declarations: [AppComponent, ...APP_DIALOGS],
entryComponents: [...APP_DIALOGS],
imports: [
EffectsModule.forRoot(APP_EFFECTS),
MyMaterialModule,
ReactiveFormsModule,
FlexLayoutModule,
SharedModule,
SpaceModule,
HttpClientModule,
JwtModule.forRoot({
const Raven = require("raven-js");
const $ = require("jquery");
// init sentry client if sentry dsn is set
if ($("body").data("raven-dsn")) {
var dsn = $("body").data("raven-dsn");
// raven itself can fail if invalid DSN is passed
try {
Raven.config(dsn, {
release: $("body").data("unsee-version")
}).install();
} catch (error) {
var msg = "Sentry error: " + error.message;
$("#raven-error").text(msg).removeClass("hidden");
}
}
import configureStore from 'app/utils/configureStore';
import renderApp from './render';
import { fetchMeta } from 'app/actions/MetaActions';
import {
loginAutomaticallyIfPossible,
maybeRefreshToken
} from 'app/actions/UserActions';
moment.locale('nb-NO');
global.log = function log(self = this) {
console.log(self);
return this;
};
raven
.config(config.ravenDSN, {
release: config.release,
environment: config.environment
})
.install();
const preloadedState = window.__PRELOADED_STATE__;
const store = configureStore(preloadedState, {
raven,
getCookie: key => cookie.get(key)
});
if (isEmpty(preloadedState)) {
store
.dispatch(loginAutomaticallyIfPossible())
.then(() => store.dispatch(fetchMeta()))
import Vue from 'vue';
import * as config from './clientConfig.json';
import * as Raven from 'raven-js';
import * as RavenVue from 'raven-js/plugins/vue';
if(config.ravenDsn != null && config.ravenDsn !== '') {
Raven.config(config.ravenDsn)
.addPlugin(RavenVue, Vue)
.install();
}
import VueApollo from 'vue-apollo';
import apolloClient, { setMaintenanceMessageHandler } from './graphqlClient';
Vue.use(VueApollo);
const apolloProvider = new VueApollo({
defaultClient: apolloClient,
defaultOptions: {
$query: {
fetchPolicy: 'no-cache',
},
} as any
});
import { createStore, compose, applyMiddleware } from "redux";
import { createLogger } from "redux-logger";
import { createEpicMiddleware } from "redux-observable";
import promise from "redux-promise";
import { persistReducer, persistStore } from "redux-persist";
import storage from "redux-persist/lib/storage";
import Raven from "raven-js";
import createRavenMiddleware from "raven-for-redux";
import { SENTRY_DSN, IS_DEV, DEBUGGING } from "../config";
import reducer from "./reducers/index";
import epics from "./epics";
Raven.config(SENTRY_DSN).install();
const middleware = [
IS_DEV && createLogger(),
createEpicMiddleware(epics),
promise,
createRavenMiddleware(Raven, {})
].filter(x => !!x);
const storeEnhancer = [applyMiddleware(...middleware)];
const persistConfig = {
key: "oyster-webnode",
storage,
whitelist: DEBUGGING ? [] : ["consent", "node", "treasureHunt"]
};
const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose;
(() => {
if (!String.prototype.includes || !Array.prototype.findIndex) return;
if (window.location.pathname.endsWith('.html')) return;
if (!['www.twitch.tv', 'canary.twitch.tv', 'clips.twitch.tv', 'dashboard.twitch.tv'].includes(window.location.hostname)) return;
if (window.Ember) return;
const IS_PROD = process.env.NODE_ENV !== 'development';
const Raven = require('raven-js');
if (IS_PROD) {
Raven.config(
process.env.SENTRY_URL,
{
release: process.env.GIT_REV,
environment: process.env.NODE_ENV,
captureUnhandledRejections: false,
ignoreErrors: [
'InvalidAccessError',
'out of memory',
'InvalidStateError',
'QuotaExceededError',
'NotFoundError',
'SecurityError',
'AbortError',
'TypeMismatchError',
'HierarchyRequestError',
'IndexSizeError',
import { HttpErrorResponse } from '@angular/common/http';
import { ErrorHandler } from '@angular/core';
import { BadInputError } from 'app/error/bad-input-error';
import { BaseError } from 'app/error/base-error';
import { ForbiddenError } from 'app/error/forbidden-error';
import { NotFoundError } from 'app/error/not-found-error';
import { UnreachableError } from 'app/error/unreachable-error';
import * as Raven from 'raven-js';
import { environment } from '../../environments/environment';
import { CustomError } from './custom-error';
Raven
.config(environment.sentryDns)
.install();
export class AppErrorHandler implements ErrorHandler {
handleError(err) {
let error: any = null;
let message: any = null;
if (err instanceof CustomError) {
error = err.originalError;
message = err.message;
} else {
error = err;
}
if (error instanceof HttpErrorResponse) {