mirror of
https://github.com/OneUptime/oneuptime.git
synced 2026-04-06 00:32:12 +02:00
remove tsexpect error
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
// @ts-expect-error ts-migrate(2307) FIXME: Cannot find module 'oneuptime-staging' or its corr... Remove this comment to see the full error message
|
||||
|
||||
import oneuptime from 'oneuptime-staging'
|
||||
|
||||
// constructor
|
||||
@@ -32,13 +32,13 @@ tracker.setTags([
|
||||
]); // an array of tags
|
||||
|
||||
// capturing error exception authomatically
|
||||
// @ts-expect-error ts-migrate(2304) FIXME: Cannot find name 'NonExistingMethodCall'.
|
||||
|
||||
NonExistingMethodCall(); // this is authomatically captured and sent to your oneuptime dashboard
|
||||
|
||||
// capturing error exception manually
|
||||
try {
|
||||
// your code logic
|
||||
// @ts-expect-error ts-migrate(2304) FIXME: Cannot find name 'NonExistingMethodCall'.
|
||||
|
||||
NonExistingMethodCall();
|
||||
} catch (error) {
|
||||
tracker.captureException(error);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// In a FrontEnd Environment
|
||||
// @ts-expect-error ts-migrate(2307) FIXME: Cannot find module 'oneuptime-staging' or its corr... Remove this comment to see the full error message
|
||||
|
||||
import oneuptime from 'oneuptime-staging';
|
||||
const Logger = oneuptime.Logger;
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import express from 'express'
|
||||
// If your env supports require
|
||||
// @ts-expect-error ts-migrate(2307) FIXME: Cannot find module 'oneuptime-staging' or its corr... Remove this comment to see the full error message
|
||||
|
||||
import OneUptime from 'oneuptime-staging'
|
||||
const app = express()
|
||||
|
||||
// @ts-expect-error ts-migrate(2307) FIXME: Cannot find module 'axios' or its corresponding ty... Remove this comment to see the full error message
|
||||
|
||||
import axios from 'axios'
|
||||
|
||||
|
||||
|
||||
@@ -1,19 +1,19 @@
|
||||
import { expect } from "chai"
|
||||
// @ts-expect-error ts-migrate(2614) FIXME: Module '"./scriptSandbox"' has no exported member ... Remove this comment to see the full error message
|
||||
|
||||
import { runScript } from "./scriptSandbox"
|
||||
import axios from 'axios';
|
||||
|
||||
// @ts-expect-error ts-migrate(2582) FIXME: Cannot find name 'describe'. Do you need to instal... Remove this comment to see the full error message
|
||||
|
||||
describe('ScriptMonitor V2', function() {
|
||||
this.timeout(10000);
|
||||
// @ts-expect-error ts-migrate(2582) FIXME: Cannot find name 'describe'. Do you need to instal... Remove this comment to see the full error message
|
||||
|
||||
describe("runScript function", function(){
|
||||
let server: $TSFixMe;
|
||||
|
||||
// create a quick express server
|
||||
// @ts-expect-error ts-migrate(2304) FIXME: Cannot find name 'before'.
|
||||
|
||||
before(function(){
|
||||
// @ts-expect-error ts-migrate(1232) FIXME: An import declaration can only be used in a namesp... Remove this comment to see the full error message
|
||||
|
||||
import express from "express"
|
||||
const app = express();
|
||||
app.get("/test", (req: $TSFixMe, res: $TSFixMe) => res.send("yipee!"));
|
||||
@@ -21,12 +21,12 @@ describe('ScriptMonitor V2', function() {
|
||||
});
|
||||
|
||||
// close express server
|
||||
// @ts-expect-error ts-migrate(2304) FIXME: Cannot find name 'after'.
|
||||
|
||||
after(function(){
|
||||
server.close();
|
||||
});
|
||||
|
||||
// @ts-expect-error ts-migrate(2582) FIXME: Cannot find name 'it'. Do you need to install type... Remove this comment to see the full error message
|
||||
|
||||
it("should return success for a valid script", async function() {
|
||||
const someFunction = async (done: $TSFixMe) => {
|
||||
|
||||
@@ -50,7 +50,7 @@ describe('ScriptMonitor V2', function() {
|
||||
|
||||
});
|
||||
|
||||
// @ts-expect-error ts-migrate(2582) FIXME: Cannot find name 'it'. Do you need to install type... Remove this comment to see the full error message
|
||||
|
||||
it("should return false for error thrown in script", async function() {
|
||||
const someFunction = async (done: $TSFixMe) => {
|
||||
console.log('Error log');
|
||||
@@ -71,7 +71,7 @@ describe('ScriptMonitor V2', function() {
|
||||
expect(result.consoleLogs).to.include('[log]: Error log');
|
||||
});
|
||||
|
||||
// @ts-expect-error ts-migrate(2582) FIXME: Cannot find name 'it'. Do you need to install type... Remove this comment to see the full error message
|
||||
|
||||
it("should return scriptMonitor error when script returns a value in cb", async function() {
|
||||
const someFunction = async (done: $TSFixMe) => {
|
||||
done("Some Error");
|
||||
@@ -87,7 +87,7 @@ describe('ScriptMonitor V2', function() {
|
||||
console.log(result.executionTime);
|
||||
});
|
||||
|
||||
// @ts-expect-error ts-migrate(2582) FIXME: Cannot find name 'it'. Do you need to install type... Remove this comment to see the full error message
|
||||
|
||||
it("should return timeout error when script takes too long", async function() {
|
||||
const someFunction = async (done: $TSFixMe) => {
|
||||
return new Promise((resolve) => {
|
||||
@@ -104,7 +104,7 @@ describe('ScriptMonitor V2', function() {
|
||||
console.log(result.executionTime);
|
||||
});
|
||||
|
||||
// @ts-expect-error ts-migrate(2582) FIXME: Cannot find name 'it'. Do you need to install type... Remove this comment to see the full error message
|
||||
|
||||
it("should return timeout error when statement takes too long", async function() {
|
||||
const someFunction = async (done: $TSFixMe) => {
|
||||
while(true){
|
||||
|
||||
@@ -176,7 +176,7 @@ const runScript = async (functionCode: $TSFixMe, isCalled: $TSFixMe, options = {
|
||||
});
|
||||
} else {
|
||||
// worker_threads code
|
||||
// @ts-expect-error ts-migrate(1232) FIXME: An import declaration can only be used in a namesp... Remove this comment to see the full error message
|
||||
|
||||
import { NodeVM } from 'vm2'
|
||||
const vm = new NodeVM({
|
||||
eval: false,
|
||||
@@ -219,6 +219,6 @@ const runScript = async (functionCode: $TSFixMe, isCalled: $TSFixMe, options = {
|
||||
}
|
||||
};
|
||||
|
||||
// @ts-expect-error ts-migrate(2554) FIXME: Expected 2-3 arguments, but got 0.
|
||||
|
||||
export default runScript();
|
||||
module.exports.runScript = runScript;
|
||||
|
||||
@@ -17,11 +17,11 @@ process.on('uncaughtException', err => {
|
||||
console.error(err);
|
||||
});
|
||||
|
||||
// @ts-expect-error ts-migrate(7016) FIXME: Could not find a declaration file for module 'expr... Remove this comment to see the full error message
|
||||
|
||||
import express from 'express';
|
||||
import path from 'path';
|
||||
const app = express();
|
||||
// @ts-expect-error ts-migrate(7016) FIXME: Could not find a declaration file for module 'comp... Remove this comment to see the full error message
|
||||
|
||||
import compression from 'compression';
|
||||
|
||||
app.use(compression());
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { fork } from 'child_process';
|
||||
const child = fork('./lighthouseWorker');
|
||||
// @ts-expect-error ts-migrate(7016) FIXME: Could not find a declaration file for module 'cli-... Remove this comment to see the full error message
|
||||
|
||||
import Table from 'cli-table';
|
||||
import program from 'commander';
|
||||
|
||||
@@ -27,24 +27,24 @@ let checksFailed = false;
|
||||
child.on('message', function(score) {
|
||||
const scores = [
|
||||
sites[sitesIndex - 1],
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'performance' does not exist on type 'Ser... Remove this comment to see the full error message
|
||||
|
||||
score.performance,
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'accessibility' does not exist on type 'S... Remove this comment to see the full error message
|
||||
|
||||
score.accessibility,
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'bestPractices' does not exist on type 'S... Remove this comment to see the full error message
|
||||
|
||||
score.bestPractices,
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'seo' does not exist on type 'Serializabl... Remove this comment to see the full error message
|
||||
|
||||
score.seo,
|
||||
];
|
||||
table.push(scores);
|
||||
if (
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'performance' does not exist on type 'Ser... Remove this comment to see the full error message
|
||||
|
||||
score.performance < 50 ||
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'accessibility' does not exist on type 'S... Remove this comment to see the full error message
|
||||
|
||||
score.accessibility < 70 ||
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'bestPractices' does not exist on type 'S... Remove this comment to see the full error message
|
||||
|
||||
score.bestPractices < 70 ||
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'seo' does not exist on type 'Serializabl... Remove this comment to see the full error message
|
||||
|
||||
score.seo < 80
|
||||
) {
|
||||
checksFailed = true;
|
||||
@@ -65,9 +65,9 @@ child.on('message', function(score) {
|
||||
});
|
||||
|
||||
function pages() {
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'mobile' does not exist on type 'Commande... Remove this comment to see the full error message
|
||||
|
||||
if (program.mobile) {
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'mobile' does not exist on type 'Commande... Remove this comment to see the full error message
|
||||
|
||||
child.send({ url: sites[sitesIndex], mobile: program.mobile });
|
||||
} else {
|
||||
child.send({ url: sites[sitesIndex], mobile: false });
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// @ts-expect-error ts-migrate(7016) FIXME: Could not find a declaration file for module 'ligh... Remove this comment to see the full error message
|
||||
|
||||
import lighthouse from 'lighthouse';
|
||||
import chromeLauncher from 'chrome-launcher';
|
||||
import ora from 'ora';
|
||||
@@ -41,7 +41,7 @@ function launchChromeAndRunLighthouse(
|
||||
config = null
|
||||
) {
|
||||
return chromeLauncher.launch(flags).then(chrome => {
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'port' does not exist on type '{}'.
|
||||
|
||||
flags.port = chrome.port;
|
||||
return lighthouse(url, flags, config).then((results: $TSFixMe) => {
|
||||
return chrome.kill().then(() => results);
|
||||
@@ -59,7 +59,7 @@ process.on('message', function(data) {
|
||||
const scores = {};
|
||||
const spinner = ora(`Running lighthouse on ${data.url}`).start();
|
||||
spinner.color = 'green';
|
||||
// @ts-expect-error ts-migrate(2345) FIXME: Argument of type '{ extends: string; settings: { m... Remove this comment to see the full error message
|
||||
|
||||
launchChromeAndRunLighthouse(data.url, flags, config)
|
||||
.then(results => {
|
||||
results.artifacts = 'ignore';
|
||||
@@ -78,35 +78,35 @@ process.on('message', function(data) {
|
||||
results.lhr.audits = 'ignore';
|
||||
results.lhr.categoryGroups = 'ignore';
|
||||
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'performance' does not exist on type '{}'... Remove this comment to see the full error message
|
||||
|
||||
scores.performance = Math.ceil(
|
||||
results.lhr.categories.performance.score * 100
|
||||
);
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'accessibility' does not exist on type '{... Remove this comment to see the full error message
|
||||
|
||||
scores.accessibility = Math.ceil(
|
||||
results.lhr.categories.accessibility.score * 100
|
||||
);
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'bestPractices' does not exist on type '{... Remove this comment to see the full error message
|
||||
|
||||
scores.bestPractices = Math.ceil(
|
||||
results.lhr.categories['best-practices'].score * 100
|
||||
);
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'seo' does not exist on type '{}'.
|
||||
|
||||
scores.seo = Math.ceil(results.lhr.categories.seo.score * 100);
|
||||
if (
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'performance' does not exist on type '{}'... Remove this comment to see the full error message
|
||||
|
||||
scores.performance < 50 ||
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'accessibility' does not exist on type '{... Remove this comment to see the full error message
|
||||
|
||||
scores.accessibility < 70 ||
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'bestPractices' does not exist on type '{... Remove this comment to see the full error message
|
||||
|
||||
scores.bestPractices < 70 ||
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'seo' does not exist on type '{}'.
|
||||
|
||||
scores.seo < 80
|
||||
) {
|
||||
spinner.fail();
|
||||
} else {
|
||||
spinner.succeed();
|
||||
}
|
||||
// @ts-expect-error ts-migrate(2722) FIXME: Cannot invoke an object which is possibly 'undefin... Remove this comment to see the full error message
|
||||
|
||||
process.send(scores);
|
||||
return scores;
|
||||
})
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// @ts-expect-error ts-migrate(2581) FIXME: Cannot find name '$'. Do you need to install type ... Remove this comment to see the full error message
|
||||
|
||||
$(document).ready(function() {
|
||||
setTimeout(()=>{
|
||||
// @ts-expect-error ts-migrate(2581) FIXME: Cannot find name '$'. Do you need to install type ... Remove this comment to see the full error message
|
||||
|
||||
$('div.bar').tipsy({
|
||||
gravity: 'se',
|
||||
html: true,
|
||||
|
||||
@@ -37,7 +37,7 @@ export function changePassword(values: $TSFixMe) {
|
||||
|
||||
promise.then(
|
||||
function(response) {
|
||||
// @ts-expect-error ts-migrate(2571) FIXME: Object is of type 'unknown'.
|
||||
|
||||
dispatch(changePasswordSuccess(response.data));
|
||||
},
|
||||
function(error) {
|
||||
|
||||
@@ -37,7 +37,7 @@ export function loginSuccess(user: $TSFixMe) {
|
||||
const { statusPageLogin, statusPageURL } = state.login;
|
||||
if (statusPageLogin) {
|
||||
const newURL = `${statusPageURL}?userId=${user.id}&accessToken=${user.tokens.jwtAccessToken}`;
|
||||
// @ts-expect-error ts-migrate(2322) FIXME: Type 'string' is not assignable to type 'Location'... Remove this comment to see the full error message
|
||||
|
||||
return (window.location = newURL);
|
||||
}
|
||||
|
||||
@@ -62,15 +62,15 @@ export function loginSuccess(user: $TSFixMe) {
|
||||
}
|
||||
|
||||
if (user.redirect && user?.tokens?.jwtAccessToken) {
|
||||
// @ts-expect-error ts-migrate(2322) FIXME: Type 'string' is not assignable to type 'Location'... Remove this comment to see the full error message
|
||||
|
||||
return (window.location = `${user.redirect}?accessToken=${user.tokens.jwtAccessToken}`);
|
||||
} else if (user.redirect) {
|
||||
return (window.location = user.redirect);
|
||||
} else if (user.role === 'master-admin') {
|
||||
// @ts-expect-error ts-migrate(2322) FIXME: Type 'string' is not assignable to type 'Location'... Remove this comment to see the full error message
|
||||
|
||||
window.location = ADMIN_DASHBOARD_URL;
|
||||
} else {
|
||||
// @ts-expect-error ts-migrate(2322) FIXME: Type 'string' is not assignable to type 'Location'... Remove this comment to see the full error message
|
||||
|
||||
window.location = DASHBOARD_URL;
|
||||
}
|
||||
|
||||
@@ -111,7 +111,7 @@ export function loginUser(values: $TSFixMe) {
|
||||
|
||||
promise.then(
|
||||
function(user) {
|
||||
// @ts-expect-error ts-migrate(2571) FIXME: Object is of type 'unknown'.
|
||||
|
||||
dispatch(loginSuccess(user.data));
|
||||
},
|
||||
function(error) {
|
||||
@@ -144,7 +144,7 @@ export const loginUserSso = (values: $TSFixMe) => async (
|
||||
) => {
|
||||
try {
|
||||
const response = await getApi(`user/sso/login?email=${values.email}`);
|
||||
// @ts-expect-error ts-migrate(2571) FIXME: Object is of type 'unknown'.
|
||||
|
||||
const { url } = response.data;
|
||||
window.location = url;
|
||||
} catch (error) {
|
||||
@@ -176,7 +176,7 @@ export function verifyAuthToken(values: $TSFixMe) {
|
||||
|
||||
promise.then(
|
||||
function(user) {
|
||||
// @ts-expect-error ts-migrate(2571) FIXME: Object is of type 'unknown'.
|
||||
|
||||
dispatch(loginSuccess(user.data));
|
||||
},
|
||||
function(error) {
|
||||
@@ -231,7 +231,7 @@ export function verifyBackupCode(values: $TSFixMe) {
|
||||
|
||||
promise.then(
|
||||
function(user) {
|
||||
// @ts-expect-error ts-migrate(2571) FIXME: Object is of type 'unknown'.
|
||||
|
||||
dispatch(loginSuccess(user.data));
|
||||
},
|
||||
function(error) {
|
||||
@@ -289,12 +289,12 @@ export const resetMasterAdminExists = () => {
|
||||
// Calls the API to register a user.
|
||||
export function checkIfMasterAdminExists(values: $TSFixMe) {
|
||||
return function(dispatch: $TSFixMe) {
|
||||
// @ts-expect-error ts-migrate(2554) FIXME: Expected 1 arguments, but got 2.
|
||||
|
||||
const promise = getApi('user/masterAdminExists', values);
|
||||
dispatch(masterAdminExistsRequest(promise));
|
||||
promise.then(
|
||||
function(response) {
|
||||
// @ts-expect-error ts-migrate(2571) FIXME: Object is of type 'unknown'.
|
||||
|
||||
dispatch(masterAdminExistsSuccess(response.data));
|
||||
},
|
||||
function(error) {
|
||||
|
||||
@@ -83,21 +83,21 @@ export function signupUser(values: $TSFixMe) {
|
||||
dispatch(signUpRequest(promise));
|
||||
promise.then(
|
||||
function(user) {
|
||||
// @ts-expect-error ts-migrate(2571) FIXME: Object is of type 'unknown'.
|
||||
|
||||
dispatch(signupSuccess(user.data));
|
||||
// @ts-expect-error ts-migrate(2571) FIXME: Object is of type 'unknown'.
|
||||
|
||||
if (user.data.role === 'master-admin' && !IS_SAAS_SERVICE) {
|
||||
// @ts-expect-error ts-migrate(2571) FIXME: Object is of type 'unknown'.
|
||||
|
||||
dispatch(loginSuccess(user.data));
|
||||
dispatch(masterAdminExistsSuccess({ result: true }));
|
||||
}
|
||||
if (values.token) {
|
||||
// @ts-expect-error ts-migrate(2571) FIXME: Object is of type 'unknown'.
|
||||
|
||||
dispatch(loginSuccess(user.data));
|
||||
}
|
||||
// @ts-expect-error ts-migrate(2571) FIXME: Object is of type 'unknown'.
|
||||
|
||||
if (user.data.cardRegistered) {
|
||||
// @ts-expect-error ts-migrate(2571) FIXME: Object is of type 'unknown'.
|
||||
|
||||
dispatch(loginSuccess(user.data));
|
||||
}
|
||||
},
|
||||
@@ -182,7 +182,7 @@ export function isUserInvited(values: $TSFixMe) {
|
||||
dispatch(isUserInvitedRequest(promise));
|
||||
promise.then(
|
||||
function(response) {
|
||||
// @ts-expect-error ts-migrate(2571) FIXME: Object is of type 'unknown'.
|
||||
|
||||
dispatch(isUserInvitedSuccess(response.data));
|
||||
},
|
||||
function(error) {
|
||||
@@ -233,7 +233,7 @@ export function addCard(data: $TSFixMe) {
|
||||
|
||||
promise.then(
|
||||
function(card) {
|
||||
// @ts-expect-error ts-migrate(2571) FIXME: Object is of type 'unknown'.
|
||||
|
||||
dispatch(addCardSuccess(card.data));
|
||||
},
|
||||
function(error) {
|
||||
@@ -266,7 +266,7 @@ export function getEmailFromToken(token: $TSFixMe) {
|
||||
const promise = getApi(`user/${token}/email`);
|
||||
promise.then(
|
||||
function(response) {
|
||||
// @ts-expect-error ts-migrate(2571) FIXME: Object is of type 'unknown'.
|
||||
|
||||
dispatch(getEmailSuccess(response.data));
|
||||
},
|
||||
function(error) {
|
||||
|
||||
@@ -14,7 +14,7 @@ const headers = {
|
||||
|
||||
export function postApi(url: $TSFixMe, data: $TSFixMe) {
|
||||
if (User.isLoggedIn())
|
||||
// @ts-expect-error ts-migrate(7053) FIXME: Element implicitly has an 'any' type because expre... Remove this comment to see the full error message
|
||||
|
||||
headers['Authorization'] = 'Basic ' + User.getAccessToken();
|
||||
const deffered = Q.defer();
|
||||
|
||||
@@ -44,7 +44,7 @@ export function postApi(url: $TSFixMe, data: $TSFixMe) {
|
||||
|
||||
export function getApi(url: $TSFixMe) {
|
||||
if (User.isLoggedIn())
|
||||
// @ts-expect-error ts-migrate(7053) FIXME: Element implicitly has an 'any' type because expre... Remove this comment to see the full error message
|
||||
|
||||
headers['Authorization'] = 'Basic ' + User.getAccessToken();
|
||||
const deffered = Q.defer();
|
||||
axios({
|
||||
@@ -73,7 +73,7 @@ export function getApi(url: $TSFixMe) {
|
||||
|
||||
export function putApi(url: $TSFixMe, data: $TSFixMe) {
|
||||
if (User.isLoggedIn())
|
||||
// @ts-expect-error ts-migrate(7053) FIXME: Element implicitly has an 'any' type because expre... Remove this comment to see the full error message
|
||||
|
||||
headers['Authorization'] = 'Basic ' + User.getAccessToken();
|
||||
const deffered = Q.defer();
|
||||
axios({
|
||||
@@ -103,7 +103,7 @@ export function putApi(url: $TSFixMe, data: $TSFixMe) {
|
||||
|
||||
export function deleteApi(url: $TSFixMe, data: $TSFixMe) {
|
||||
if (User.isLoggedIn())
|
||||
// @ts-expect-error ts-migrate(7053) FIXME: Element implicitly has an 'any' type because expre... Remove this comment to see the full error message
|
||||
|
||||
headers['Authorization'] = 'Basic ' + User.getAccessToken();
|
||||
const deffered = Q.defer();
|
||||
axios({
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { combineReducers } from 'redux';
|
||||
// @ts-expect-error ts-migrate(7016) FIXME: Could not find a declaration file for module 'reac... Remove this comment to see the full error message
|
||||
|
||||
import { routerReducer } from 'react-router-redux';
|
||||
import login from './login';
|
||||
import register from './register';
|
||||
// @ts-expect-error ts-migrate(7016) FIXME: Could not find a declaration file for module 'redu... Remove this comment to see the full error message
|
||||
|
||||
import { reducer as formReducer } from 'redux-form';
|
||||
import modal from './modal';
|
||||
import resetPassword from './resetPassword';
|
||||
|
||||
@@ -15,7 +15,7 @@ export default (state = initialState, action: $TSFixMe) => {
|
||||
case CLOSE_MODAL:
|
||||
return Object.assign({}, state, {
|
||||
modals: state.modals.filter(
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'id' does not exist on type 'never'.
|
||||
|
||||
item => item.id !== action.payload.id
|
||||
),
|
||||
});
|
||||
|
||||
@@ -54,7 +54,7 @@ export default function register(state = initialState, action: $TSFixMe) {
|
||||
error: null,
|
||||
});
|
||||
case SIGNUP_SUCCESS:
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'cardRegistered' does not exist on type '... Remove this comment to see the full error message
|
||||
|
||||
state.user.cardRegistered = action.payload.cardRegistered;
|
||||
return Object.assign({}, state, {
|
||||
requesting: false,
|
||||
|
||||
@@ -130,19 +130,19 @@ export const allRoutes = groups
|
||||
const newSubRoutes = [];
|
||||
for (const subRoute of route.subRoutes) {
|
||||
newSubRoutes.push(subRoute);
|
||||
// @ts-expect-error ts-migrate(2698) FIXME: Spread types may only be created from object types... Remove this comment to see the full error message
|
||||
|
||||
const tempRoute = { ...subRoute };
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'path' does not exist on type 'never'.
|
||||
|
||||
tempRoute.path = '/accounts' + subRoute.path;
|
||||
newSubRoutes.push(tempRoute);
|
||||
}
|
||||
return newSubRoutes;
|
||||
})
|
||||
// @ts-expect-error ts-migrate(2345) FIXME: Argument of type '(acc: never[] | undefined, curr:... Remove this comment to see the full error message
|
||||
|
||||
.reduce(joinFn);
|
||||
return newRoutes.concat(subRoutes);
|
||||
})
|
||||
// @ts-expect-error ts-migrate(2345) FIXME: Argument of type '(acc: never[] | undefined, curr:... Remove this comment to see the full error message
|
||||
|
||||
.reduce(joinFn);
|
||||
|
||||
export const getGroups = () => groups;
|
||||
|
||||
@@ -23,7 +23,7 @@ const isLocalhost = Boolean(
|
||||
export function register(config: $TSFixMe) {
|
||||
if ('serviceWorker' in navigator) {
|
||||
// The URL constructor is available in all browsers that support SW.
|
||||
// @ts-expect-error ts-migrate(2345) FIXME: Argument of type 'string | undefined' is not assig... Remove this comment to see the full error message
|
||||
|
||||
const publicUrl = new URL(process.env.PUBLIC_URL, window.location.href);
|
||||
if (publicUrl.origin !== window.location.origin) {
|
||||
// Our service worker won't work if PUBLIC_URL is on a different origin
|
||||
@@ -47,15 +47,15 @@ export function register(config: $TSFixMe) {
|
||||
});
|
||||
|
||||
window.addEventListener('fetch', event => {
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'respondWith' does not exist on type 'Eve... Remove this comment to see the full error message
|
||||
|
||||
event.respondWith(
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'request' does not exist on type 'Event'.
|
||||
|
||||
caches.match(event.request).then(function(response) {
|
||||
// Cache hit - return response
|
||||
if (response) {
|
||||
return response;
|
||||
}
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'request' does not exist on type 'Event'.
|
||||
|
||||
return fetch(event.request);
|
||||
})
|
||||
);
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import { createStore, applyMiddleware, compose } from 'redux';
|
||||
// @ts-expect-error ts-migrate(7016) FIXME: Could not find a declaration file for module 'redu... Remove this comment to see the full error message
|
||||
|
||||
import { createLogger } from 'redux-logger';
|
||||
// @ts-expect-error ts-migrate(7016) FIXME: Could not find a declaration file for module 'reac... Remove this comment to see the full error message
|
||||
|
||||
import { routerMiddleware } from 'react-router-redux';
|
||||
import thunk from 'redux-thunk';
|
||||
// @ts-expect-error ts-migrate(7016) FIXME: Could not find a declaration file for module 'quer... Remove this comment to see the full error message
|
||||
|
||||
import queryString from 'query-string';
|
||||
// @ts-expect-error ts-migrate(7016) FIXME: Could not find a declaration file for module 'hist... Remove this comment to see the full error message
|
||||
|
||||
import { createBrowserHistory, createMemoryHistory } from 'history';
|
||||
// import createHistory from 'history/createBrowserHistory';
|
||||
import rootReducer from './reducers';
|
||||
@@ -42,7 +42,7 @@ const middleware = [thunk, routerMiddleware(history)];
|
||||
if (process.env.NODE_ENV === 'development') {
|
||||
let devToolsExtension;
|
||||
if (!isServer) {
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'devToolsExtension' does not exist on typ... Remove this comment to see the full error message
|
||||
|
||||
devToolsExtension = window.devToolsExtension;
|
||||
}
|
||||
middleware.push(logger);
|
||||
|
||||
@@ -3,11 +3,11 @@ if ('function' === typeof importScripts) {
|
||||
'https://storage.googleapis.com/workbox-cdn/releases/6.1.1/workbox-sw.js'
|
||||
);
|
||||
|
||||
// @ts-expect-error ts-migrate(2304) FIXME: Cannot find name 'workbox'.
|
||||
|
||||
if (workbox) {
|
||||
// @ts-expect-error ts-migrate(2304) FIXME: Cannot find name 'workbox'.
|
||||
|
||||
const { skipWaiting, clientsClaim } = workbox.core;
|
||||
// @ts-expect-error ts-migrate(2304) FIXME: Cannot find name 'workbox'.
|
||||
|
||||
const { precacheAndRoute, cleanupOutdatedCaches } = workbox.precaching;
|
||||
|
||||
// skip waiting and switch to activating stage
|
||||
@@ -18,7 +18,7 @@ if ('function' === typeof importScripts) {
|
||||
cleanupOutdatedCaches();
|
||||
|
||||
/* injection point for manifest files. */
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property '__WB_MANIFEST' does not exist on type 'W... Remove this comment to see the full error message
|
||||
|
||||
precacheAndRoute(self.__WB_MANIFEST, { cleanUrls: false });
|
||||
} else {
|
||||
// eslint-disable-next-line no-console
|
||||
|
||||
@@ -17,7 +17,7 @@ process.on('uncaughtException', err => {
|
||||
console.error(err);
|
||||
});
|
||||
|
||||
// @ts-expect-error ts-migrate(7016) FIXME: Could not find a declaration file for module 'expr... Remove this comment to see the full error message
|
||||
|
||||
import express from 'express';
|
||||
import path from 'path';
|
||||
const app = express();
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// @ts-expect-error ts-migrate(2581) FIXME: Cannot find name '$'. Do you need to install type ... Remove this comment to see the full error message
|
||||
|
||||
$(document).ready(function() {
|
||||
setTimeout(()=>{
|
||||
// @ts-expect-error ts-migrate(2581) FIXME: Cannot find name '$'. Do you need to install type ... Remove this comment to see the full error message
|
||||
|
||||
$('div.bar').tipsy({
|
||||
gravity: 'se',
|
||||
html: true,
|
||||
|
||||
@@ -32,9 +32,9 @@ export const fetchAuditLogs = (skip: $TSFixMe, limit: $TSFixMe) => async (
|
||||
dispatch(fetchAuditLogsRequest());
|
||||
|
||||
try {
|
||||
// @ts-expect-error ts-migrate(2554) FIXME: Expected 2 arguments, but got 1.
|
||||
|
||||
const response = await getApi(`audit-logs?skip=${skip}&limit=${limit}`);
|
||||
// @ts-expect-error ts-migrate(2571) FIXME: Object is of type 'unknown'.
|
||||
|
||||
const data = response.data;
|
||||
|
||||
dispatch(fetchAuditLogsSuccess(data));
|
||||
@@ -89,12 +89,12 @@ export const searchAuditLogs = (
|
||||
dispatch(searchAuditLogsRequest());
|
||||
|
||||
try {
|
||||
// @ts-expect-error ts-migrate(2554) FIXME: Expected 3 arguments, but got 2.
|
||||
|
||||
const response = await postApi(
|
||||
`audit-logs/search?skip=${skip}&limit=${limit}`,
|
||||
values
|
||||
);
|
||||
// @ts-expect-error ts-migrate(2571) FIXME: Object is of type 'unknown'.
|
||||
|
||||
const data = response.data;
|
||||
|
||||
dispatch(searchAuditLogsSuccess(data));
|
||||
@@ -140,9 +140,9 @@ export const deleteAuditLogs = () => async (dispatch: $TSFixMe) => {
|
||||
dispatch(deleteAuditLogsRequest());
|
||||
|
||||
try {
|
||||
// @ts-expect-error ts-migrate(2554) FIXME: Expected 2 arguments, but got 1.
|
||||
|
||||
const response = await deleteApi(`audit-logs`);
|
||||
// @ts-expect-error ts-migrate(2571) FIXME: Object is of type 'unknown'.
|
||||
|
||||
const message = response.data.message;
|
||||
|
||||
dispatch(deleteAuditLogsSuccess(message));
|
||||
@@ -193,13 +193,13 @@ export const resetFetchAuditLogStatus = () => {
|
||||
|
||||
// Calls the API to fetch auditLogStatus
|
||||
export const fetchAuditLogStatus = () => async (dispatch: $TSFixMe) => {
|
||||
// @ts-expect-error ts-migrate(2554) FIXME: Expected 1 arguments, but got 0.
|
||||
|
||||
dispatch(fetchAuditLogStatusRequest());
|
||||
|
||||
try {
|
||||
// @ts-expect-error ts-migrate(2554) FIXME: Expected 2 arguments, but got 1.
|
||||
|
||||
const response = await getApi('globalConfig/auditLogMonitoringStatus');
|
||||
// @ts-expect-error ts-migrate(2571) FIXME: Object is of type 'unknown'.
|
||||
|
||||
dispatch(fetchAuditLogStatusSuccess(response.data));
|
||||
return response;
|
||||
} catch (error) {
|
||||
@@ -252,15 +252,15 @@ export const resetConfirmAuditLogStatus = () => {
|
||||
export const auditLogStatusChange = (values: $TSFixMe) => async (
|
||||
dispatch: $TSFixMe
|
||||
) => {
|
||||
// @ts-expect-error ts-migrate(2554) FIXME: Expected 1 arguments, but got 0.
|
||||
|
||||
dispatch(changeAuditLogStatusRequest());
|
||||
|
||||
try {
|
||||
// @ts-expect-error ts-migrate(2554) FIXME: Expected 3 arguments, but got 2.
|
||||
|
||||
const response = await postApi('globalConfig/', [
|
||||
{ name: 'auditLogMonitoringStatus', value: values.status },
|
||||
]);
|
||||
// @ts-expect-error ts-migrate(2571) FIXME: Object is of type 'unknown'.
|
||||
|
||||
const data = response.data;
|
||||
dispatch(changeAuditLogStatusSuccess(data));
|
||||
return data;
|
||||
|
||||
@@ -32,9 +32,9 @@ export const fetchCallLogs = (skip: $TSFixMe, limit: $TSFixMe) => async (
|
||||
dispatch(fetchCallLogsRequest());
|
||||
|
||||
try {
|
||||
// @ts-expect-error ts-migrate(2554) FIXME: Expected 2 arguments, but got 1.
|
||||
|
||||
const response = await getApi(`call-logs?skip=${skip}&limit=${limit}`);
|
||||
// @ts-expect-error ts-migrate(2571) FIXME: Object is of type 'unknown'.
|
||||
|
||||
const data = response.data;
|
||||
|
||||
dispatch(fetchCallLogsSuccess(data));
|
||||
@@ -89,12 +89,12 @@ export const searchCallLogs = (
|
||||
dispatch(searchCallLogsRequest());
|
||||
|
||||
try {
|
||||
// @ts-expect-error ts-migrate(2554) FIXME: Expected 3 arguments, but got 2.
|
||||
|
||||
const response = await postApi(
|
||||
`call-logs/search?skip=${skip}&limit=${limit}`,
|
||||
values
|
||||
);
|
||||
// @ts-expect-error ts-migrate(2571) FIXME: Object is of type 'unknown'.
|
||||
|
||||
const data = response.data;
|
||||
|
||||
dispatch(searchCallLogsSuccess(data));
|
||||
@@ -140,9 +140,9 @@ export const deleteCallLogs = () => async (dispatch: $TSFixMe) => {
|
||||
dispatch(deleteCallLogsRequest());
|
||||
|
||||
try {
|
||||
// @ts-expect-error ts-migrate(2554) FIXME: Expected 2 arguments, but got 1.
|
||||
|
||||
const response = await deleteApi(`call-logs`);
|
||||
// @ts-expect-error ts-migrate(2571) FIXME: Object is of type 'unknown'.
|
||||
|
||||
const message = response.data.message;
|
||||
|
||||
dispatch(deleteCallLogsSuccess(message));
|
||||
@@ -193,13 +193,13 @@ export const resetFetchCallLogStatus = () => {
|
||||
|
||||
// Calls the API to fetch callLogStatus
|
||||
export const fetchCallLogStatus = () => async (dispatch: $TSFixMe) => {
|
||||
// @ts-expect-error ts-migrate(2554) FIXME: Expected 1 arguments, but got 0.
|
||||
|
||||
dispatch(fetchCallLogStatusRequest());
|
||||
|
||||
try {
|
||||
// @ts-expect-error ts-migrate(2554) FIXME: Expected 2 arguments, but got 1.
|
||||
|
||||
const response = await getApi('globalConfig/callLogMonitoringStatus');
|
||||
// @ts-expect-error ts-migrate(2571) FIXME: Object is of type 'unknown'.
|
||||
|
||||
dispatch(fetchCallLogStatusSuccess(response.data));
|
||||
return response;
|
||||
} catch (error) {
|
||||
@@ -252,15 +252,15 @@ export const resetConfirmCallLogStatus = () => {
|
||||
export const callLogStatusChange = (values: $TSFixMe) => async (
|
||||
dispatch: $TSFixMe
|
||||
) => {
|
||||
// @ts-expect-error ts-migrate(2554) FIXME: Expected 1 arguments, but got 0.
|
||||
|
||||
dispatch(changeCallLogStatusRequest());
|
||||
|
||||
try {
|
||||
// @ts-expect-error ts-migrate(2554) FIXME: Expected 3 arguments, but got 2.
|
||||
|
||||
const response = await postApi('globalConfig/', [
|
||||
{ name: 'callLogMonitoringStatus', value: values.status },
|
||||
]);
|
||||
// @ts-expect-error ts-migrate(2571) FIXME: Object is of type 'unknown'.
|
||||
|
||||
const data = response.data;
|
||||
dispatch(changeCallLogStatusSuccess(data));
|
||||
return data;
|
||||
|
||||
@@ -31,7 +31,7 @@ export const loadDashboard = () => async (dispatch: $TSFixMe) => {
|
||||
dispatch(dashboardLoadRequest());
|
||||
|
||||
try {
|
||||
// @ts-expect-error ts-migrate(2554) FIXME: Expected 2 arguments, but got 1.
|
||||
|
||||
const response = await getApi(`user/users?skip=${skip}&limit=${limit}`);
|
||||
dispatch(dashboardLoadSuccess());
|
||||
|
||||
|
||||
@@ -32,9 +32,9 @@ export const fetchEmailLogs = (skip: $TSFixMe, limit: $TSFixMe) => async (
|
||||
dispatch(fetchEmailLogsRequest());
|
||||
|
||||
try {
|
||||
// @ts-expect-error ts-migrate(2554) FIXME: Expected 2 arguments, but got 1.
|
||||
|
||||
const response = await getApi(`email-logs?skip=${skip}&limit=${limit}`);
|
||||
// @ts-expect-error ts-migrate(2571) FIXME: Object is of type 'unknown'.
|
||||
|
||||
const data = response.data;
|
||||
|
||||
dispatch(fetchEmailLogsSuccess(data));
|
||||
@@ -89,12 +89,12 @@ export const searchEmailLogs = (
|
||||
dispatch(searchEmailLogsRequest());
|
||||
|
||||
try {
|
||||
// @ts-expect-error ts-migrate(2554) FIXME: Expected 3 arguments, but got 2.
|
||||
|
||||
const response = await postApi(
|
||||
`email-logs/search?skip=${skip}&limit=${limit}`,
|
||||
values
|
||||
);
|
||||
// @ts-expect-error ts-migrate(2571) FIXME: Object is of type 'unknown'.
|
||||
|
||||
const data = response.data;
|
||||
|
||||
dispatch(searchEmailLogsSuccess(data));
|
||||
@@ -140,9 +140,9 @@ export const deleteEmailLogs = () => async (dispatch: $TSFixMe) => {
|
||||
dispatch(deleteEmailLogsRequest());
|
||||
|
||||
try {
|
||||
// @ts-expect-error ts-migrate(2554) FIXME: Expected 2 arguments, but got 1.
|
||||
|
||||
const response = await deleteApi(`email-logs`);
|
||||
// @ts-expect-error ts-migrate(2571) FIXME: Object is of type 'unknown'.
|
||||
|
||||
const message = response.data.message;
|
||||
|
||||
dispatch(deleteEmailLogsSuccess(message));
|
||||
@@ -193,13 +193,13 @@ export const resetFetchEmailLogStatus = () => {
|
||||
|
||||
// Calls the API to fetch emailLogStatus
|
||||
export const fetchEmailLogStatus = () => async (dispatch: $TSFixMe) => {
|
||||
// @ts-expect-error ts-migrate(2554) FIXME: Expected 1 arguments, but got 0.
|
||||
|
||||
dispatch(fetchEmailLogStatusRequest());
|
||||
|
||||
try {
|
||||
// @ts-expect-error ts-migrate(2554) FIXME: Expected 2 arguments, but got 1.
|
||||
|
||||
const response = await getApi('globalConfig/emailLogMonitoringStatus');
|
||||
// @ts-expect-error ts-migrate(2571) FIXME: Object is of type 'unknown'.
|
||||
|
||||
dispatch(fetchEmailLogStatusSuccess(response.data));
|
||||
return response;
|
||||
} catch (error) {
|
||||
@@ -252,15 +252,15 @@ export const resetConfirmEmailLogStatus = () => {
|
||||
export const emailLogStatusChange = (values: $TSFixMe) => async (
|
||||
dispatch: $TSFixMe
|
||||
) => {
|
||||
// @ts-expect-error ts-migrate(2554) FIXME: Expected 1 arguments, but got 0.
|
||||
|
||||
dispatch(changeEmailLogStatusRequest());
|
||||
|
||||
try {
|
||||
// @ts-expect-error ts-migrate(2554) FIXME: Expected 3 arguments, but got 2.
|
||||
|
||||
const response = await postApi('globalConfig/', [
|
||||
{ name: 'emailLogMonitoringStatus', value: values.status },
|
||||
]);
|
||||
// @ts-expect-error ts-migrate(2571) FIXME: Object is of type 'unknown'.
|
||||
|
||||
const data = response.data;
|
||||
dispatch(changeEmailLogStatusSuccess(data));
|
||||
return data;
|
||||
|
||||
@@ -33,18 +33,18 @@ export const resetFetchLicense = () => {
|
||||
|
||||
// Calls the API to fetch license
|
||||
export const fetchLicense = () => async (dispatch: $TSFixMe) => {
|
||||
// @ts-expect-error ts-migrate(2554) FIXME: Expected 1 arguments, but got 0.
|
||||
|
||||
dispatch(fetchLicenseRequest());
|
||||
dispatch(resetConfirmLicense());
|
||||
|
||||
try {
|
||||
// @ts-expect-error ts-migrate(2554) FIXME: Expected 3 arguments, but got 2.
|
||||
|
||||
const response = await postApi('globalConfig/configs', [
|
||||
'licenseKey',
|
||||
'licenseEmail',
|
||||
'licenseToken',
|
||||
]);
|
||||
// @ts-expect-error ts-migrate(2571) FIXME: Object is of type 'unknown'.
|
||||
|
||||
const data = response.data;
|
||||
dispatch(fetchLicenseSuccess(data));
|
||||
return data;
|
||||
@@ -98,21 +98,21 @@ export const resetConfirmLicense = () => {
|
||||
export const confirmLicense = (values: $TSFixMe) => async (
|
||||
dispatch: $TSFixMe
|
||||
) => {
|
||||
// @ts-expect-error ts-migrate(2554) FIXME: Expected 1 arguments, but got 0.
|
||||
|
||||
dispatch(confirmLicenseRequest());
|
||||
|
||||
try {
|
||||
const response = await postApi('license/validate/', values, true);
|
||||
// @ts-expect-error ts-migrate(2571) FIXME: Object is of type 'unknown'.
|
||||
|
||||
let data = response.data;
|
||||
if (data.token) {
|
||||
// @ts-expect-error ts-migrate(2554) FIXME: Expected 3 arguments, but got 2.
|
||||
|
||||
const response = await postApi('globalConfig/', [
|
||||
{ name: 'licenseKey', value: values.license },
|
||||
{ name: 'licenseEmail', value: values.email },
|
||||
{ name: 'licenseToken', value: data.token },
|
||||
]);
|
||||
// @ts-expect-error ts-migrate(2571) FIXME: Object is of type 'unknown'.
|
||||
|
||||
data = response.data;
|
||||
}
|
||||
dispatch(confirmLicenseSuccess(data));
|
||||
|
||||
@@ -31,7 +31,7 @@ export function logoutUser() {
|
||||
cookies.remove('data', { path: '/' });
|
||||
localStorage.clear();
|
||||
dispatch(receiveLogout());
|
||||
// @ts-expect-error ts-migrate(2322) FIXME: Type 'string' is not assignable to type 'Location'... Remove this comment to see the full error message
|
||||
|
||||
window.location = ACCOUNTS_URL;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -33,24 +33,24 @@ export const resetProbe = () => {
|
||||
|
||||
// Gets project Probes
|
||||
export function getProbes(skip = 0, limit = 10) {
|
||||
// @ts-expect-error ts-migrate(2345) FIXME: Argument of type 'number' is not assignable to par... Remove this comment to see the full error message
|
||||
|
||||
skip = parseInt(skip);
|
||||
// @ts-expect-error ts-migrate(2345) FIXME: Argument of type 'number' is not assignable to par... Remove this comment to see the full error message
|
||||
|
||||
limit = parseInt(limit);
|
||||
|
||||
return function(dispatch: $TSFixMe) {
|
||||
let promise = null;
|
||||
// @ts-expect-error ts-migrate(2554) FIXME: Expected 2 arguments, but got 1.
|
||||
|
||||
promise = getApi(`probe/?skip=${skip}&limit=${limit}`);
|
||||
dispatch(probeRequest(promise));
|
||||
|
||||
promise.then(
|
||||
function(probes) {
|
||||
// @ts-expect-error ts-migrate(2571) FIXME: Object is of type 'unknown'.
|
||||
|
||||
probes.data.skip = skip || 0;
|
||||
// @ts-expect-error ts-migrate(2571) FIXME: Object is of type 'unknown'.
|
||||
|
||||
probes.data.limit = limit || 10;
|
||||
// @ts-expect-error ts-migrate(2571) FIXME: Object is of type 'unknown'.
|
||||
|
||||
dispatch(probeSuccess(probes.data));
|
||||
},
|
||||
function(error) {
|
||||
@@ -104,7 +104,7 @@ export const deleteProbe = (probeId: $TSFixMe) => async (
|
||||
dispatch(deleteProbeRequest());
|
||||
|
||||
try {
|
||||
// @ts-expect-error ts-migrate(2554) FIXME: Expected 2 arguments, but got 1.
|
||||
|
||||
const response = await deleteApi(`probe/${probeId}`);
|
||||
dispatch(deleteProbeSuccess(probeId));
|
||||
return response;
|
||||
@@ -164,9 +164,9 @@ export const addProbe = (probeKey: $TSFixMe, probeName: $TSFixMe) => async (
|
||||
dispatch(addProbeRequest());
|
||||
|
||||
try {
|
||||
// @ts-expect-error ts-migrate(2554) FIXME: Expected 3 arguments, but got 2.
|
||||
|
||||
const response = await postApi('probe/', { probeKey, probeName });
|
||||
// @ts-expect-error ts-migrate(2571) FIXME: Object is of type 'unknown'.
|
||||
|
||||
const data = response.data;
|
||||
dispatch(addProbeSuccess(data));
|
||||
return 'ok';
|
||||
@@ -224,7 +224,7 @@ export const updateProbe = (values: $TSFixMe) => async (dispatch: $TSFixMe) => {
|
||||
data.append('id', values.id);
|
||||
|
||||
const response = await putApi('probe/update/image', data);
|
||||
// @ts-expect-error ts-migrate(2571) FIXME: Object is of type 'unknown'.
|
||||
|
||||
const resp = response.data;
|
||||
if (Object.keys(resp).length > 0) {
|
||||
dispatch(updateProbeSuccess(resp));
|
||||
|
||||
@@ -34,12 +34,12 @@ export const fetchProjects = (skip: $TSFixMe, limit: $TSFixMe) => async (
|
||||
dispatch(fetchProjectsRequest());
|
||||
|
||||
try {
|
||||
// @ts-expect-error ts-migrate(2554) FIXME: Expected 2 arguments, but got 1.
|
||||
|
||||
const response = await getApi(
|
||||
`project/projects/allProjects?skip=${skip}&limit=${limit}`
|
||||
);
|
||||
|
||||
// @ts-expect-error ts-migrate(2571) FIXME: Object is of type 'unknown'.
|
||||
|
||||
dispatch(fetchProjectsSuccess(response.data));
|
||||
return response;
|
||||
} catch (error) {
|
||||
@@ -83,9 +83,9 @@ export const fetchProject = (slug: $TSFixMe) => async (dispatch: $TSFixMe) => {
|
||||
dispatch(fetchProjectRequest());
|
||||
|
||||
try {
|
||||
// @ts-expect-error ts-migrate(2554) FIXME: Expected 2 arguments, but got 1.
|
||||
|
||||
const response = await getApi(`project/projects/${slug}`);
|
||||
// @ts-expect-error ts-migrate(2571) FIXME: Object is of type 'unknown'.
|
||||
|
||||
const projects = response.data;
|
||||
|
||||
dispatch(fetchProjectSuccess(projects));
|
||||
@@ -130,12 +130,12 @@ export function userCreateError(error: $TSFixMe) {
|
||||
// Calls the API to add users to project.
|
||||
export function userCreate(projectId: $TSFixMe, values: $TSFixMe) {
|
||||
return function(dispatch: $TSFixMe) {
|
||||
// @ts-expect-error ts-migrate(2554) FIXME: Expected 3 arguments, but got 2.
|
||||
|
||||
const promise = postApi(`team/${projectId}`, values);
|
||||
dispatch(userCreateRequest());
|
||||
promise.then(
|
||||
function(response) {
|
||||
// @ts-expect-error ts-migrate(2571) FIXME: Object is of type 'unknown'.
|
||||
|
||||
const data = response.data;
|
||||
const projectUsers = data.filter(
|
||||
(team: $TSFixMe) => team.projectId === projectId
|
||||
@@ -187,9 +187,9 @@ export const fetchProjectTeam = (projectId: $TSFixMe) => async (
|
||||
) => {
|
||||
dispatch(fetchProjectTeamRequest());
|
||||
try {
|
||||
// @ts-expect-error ts-migrate(2554) FIXME: Expected 2 arguments, but got 1.
|
||||
|
||||
const response = await getApi(`team/${projectId}/teamMembers`);
|
||||
// @ts-expect-error ts-migrate(2571) FIXME: Object is of type 'unknown'.
|
||||
|
||||
const team = response.data;
|
||||
const projectTeam = team.filter(
|
||||
(team: $TSFixMe) => team._id === projectId
|
||||
@@ -269,7 +269,7 @@ export function userUpdateRole(projectId: $TSFixMe, values: $TSFixMe) {
|
||||
|
||||
promise.then(
|
||||
function(response) {
|
||||
// @ts-expect-error ts-migrate(2571) FIXME: Object is of type 'unknown'.
|
||||
|
||||
const data = response.data;
|
||||
const projectUsers = data.filter(
|
||||
(user: $TSFixMe) => user.projectId === projectId
|
||||
@@ -326,7 +326,7 @@ export const updateBalance = (
|
||||
const response = await putApi(`project/${projectId}/updateBalance`, {
|
||||
rechargeBalanceAmount,
|
||||
});
|
||||
// @ts-expect-error ts-migrate(2571) FIXME: Object is of type 'unknown'.
|
||||
|
||||
const data = response.data;
|
||||
dispatch(updateProjectBalanceSuccess(data));
|
||||
return response;
|
||||
@@ -373,7 +373,7 @@ export function teamDelete(projectId: $TSFixMe, teamMemberId: $TSFixMe) {
|
||||
|
||||
promise.then(
|
||||
function(response) {
|
||||
// @ts-expect-error ts-migrate(2571) FIXME: Object is of type 'unknown'.
|
||||
|
||||
const team = response.data;
|
||||
const projectTeam = team.filter(
|
||||
(team: $TSFixMe) => team.projectId === projectId
|
||||
@@ -444,11 +444,11 @@ export const fetchUserProjects = (
|
||||
dispatch(fetchUserProjectsRequest());
|
||||
|
||||
try {
|
||||
// @ts-expect-error ts-migrate(2554) FIXME: Expected 2 arguments, but got 1.
|
||||
|
||||
const response = await getApi(
|
||||
`project/projects/user/${userId}?skip=${skip}&limit=${limit}`
|
||||
);
|
||||
// @ts-expect-error ts-migrate(2571) FIXME: Object is of type 'unknown'.
|
||||
|
||||
const users = response.data;
|
||||
|
||||
dispatch(fetchUserProjectsSuccess(users));
|
||||
@@ -503,9 +503,9 @@ export const deleteProject = (projectId: $TSFixMe) => async (
|
||||
dispatch(deleteProjectRequest());
|
||||
|
||||
try {
|
||||
// @ts-expect-error ts-migrate(2554) FIXME: Expected 2 arguments, but got 1.
|
||||
|
||||
const response = await deleteApi(`project/${projectId}/deleteProject`);
|
||||
// @ts-expect-error ts-migrate(2571) FIXME: Object is of type 'unknown'.
|
||||
|
||||
const data = response.data;
|
||||
|
||||
dispatch(deleteProjectSuccess(data));
|
||||
@@ -560,9 +560,9 @@ export const blockProject = (projectId: $TSFixMe) => async (
|
||||
dispatch(blockProjectRequest());
|
||||
|
||||
try {
|
||||
// @ts-expect-error ts-migrate(2554) FIXME: Expected 2 arguments, but got 1.
|
||||
|
||||
const response = await putApi(`project/${projectId}/blockProject`);
|
||||
// @ts-expect-error ts-migrate(2571) FIXME: Object is of type 'unknown'.
|
||||
|
||||
const data = response.data;
|
||||
|
||||
dispatch(blockProjectSuccess(data));
|
||||
@@ -621,7 +621,7 @@ export const renewAlertLimit = (
|
||||
const response = await putApi(`project/${projectId}/renewAlertLimit`, {
|
||||
alertLimit,
|
||||
});
|
||||
// @ts-expect-error ts-migrate(2571) FIXME: Object is of type 'unknown'.
|
||||
|
||||
const data = response.data;
|
||||
|
||||
dispatch(renewAlertLimitSuccess(data));
|
||||
@@ -676,9 +676,9 @@ export const restoreProject = (projectId: $TSFixMe) => async (
|
||||
dispatch(restoreProjectRequest());
|
||||
|
||||
try {
|
||||
// @ts-expect-error ts-migrate(2554) FIXME: Expected 2 arguments, but got 1.
|
||||
|
||||
const response = await putApi(`project/${projectId}/restoreProject`);
|
||||
// @ts-expect-error ts-migrate(2571) FIXME: Object is of type 'unknown'.
|
||||
|
||||
const data = response.data;
|
||||
|
||||
dispatch(restoreProjectSuccess(data));
|
||||
@@ -733,9 +733,9 @@ export const unblockProject = (projectId: $TSFixMe) => async (
|
||||
dispatch(unblockProjectRequest());
|
||||
|
||||
try {
|
||||
// @ts-expect-error ts-migrate(2554) FIXME: Expected 2 arguments, but got 1.
|
||||
|
||||
const response = await putApi(`project/${projectId}/unblockProject`);
|
||||
// @ts-expect-error ts-migrate(2571) FIXME: Object is of type 'unknown'.
|
||||
|
||||
const data = response.data;
|
||||
|
||||
dispatch(unblockProjectSuccess(data));
|
||||
@@ -790,9 +790,9 @@ export const addProjectNote = (projectId: $TSFixMe, values: $TSFixMe) => async (
|
||||
dispatch(addProjectNoteRequest());
|
||||
|
||||
try {
|
||||
// @ts-expect-error ts-migrate(2554) FIXME: Expected 3 arguments, but got 2.
|
||||
|
||||
const response = await postApi(`project/${projectId}/addNote`, values);
|
||||
// @ts-expect-error ts-migrate(2571) FIXME: Object is of type 'unknown'.
|
||||
|
||||
const data = response.data;
|
||||
|
||||
dispatch(addProjectNoteSuccess(data));
|
||||
@@ -853,12 +853,12 @@ export const searchProjects = (
|
||||
dispatch(searchProjectsRequest());
|
||||
|
||||
try {
|
||||
// @ts-expect-error ts-migrate(2554) FIXME: Expected 3 arguments, but got 2.
|
||||
|
||||
const response = await postApi(
|
||||
`project/projects/search?skip=${skip}&limit=${limit}`,
|
||||
values
|
||||
);
|
||||
// @ts-expect-error ts-migrate(2571) FIXME: Object is of type 'unknown'.
|
||||
|
||||
const data = response.data;
|
||||
|
||||
dispatch(searchProjectsSuccess(data));
|
||||
@@ -916,7 +916,7 @@ export const changePlan = (
|
||||
oldPlan,
|
||||
newPlan,
|
||||
});
|
||||
// @ts-expect-error ts-migrate(2571) FIXME: Object is of type 'unknown'.
|
||||
|
||||
dispatch(changePlanSuccess(response.data));
|
||||
} catch (error) {
|
||||
const errorMsg =
|
||||
@@ -956,13 +956,13 @@ export function fetchProjectDomains(projectId: $TSFixMe, skip = 0, limit = 10) {
|
||||
dispatch(fetchProjectDomainsRequest());
|
||||
|
||||
try {
|
||||
// @ts-expect-error ts-migrate(2554) FIXME: Expected 2 arguments, but got 1.
|
||||
|
||||
const response = await getApi(
|
||||
`domainVerificationToken/${projectId}/domains?skip=${skip}&limit=${limit}`
|
||||
);
|
||||
// @ts-expect-error ts-migrate(2571) FIXME: Object is of type 'unknown'.
|
||||
|
||||
dispatch(fetchProjectDomainsSuccess(response.data));
|
||||
// @ts-expect-error ts-migrate(2571) FIXME: Object is of type 'unknown'.
|
||||
|
||||
return response.data;
|
||||
} catch (error) {
|
||||
const errorMessage =
|
||||
@@ -1007,15 +1007,15 @@ export function resetDeleteProjectDomain() {
|
||||
export function deleteProjectDomain({ projectId, domainId }: $TSFixMe) {
|
||||
return async function(dispatch: $TSFixMe) {
|
||||
dispatch(deleteProjectDomainRequest());
|
||||
// @ts-expect-error ts-migrate(2554) FIXME: Expected 2 arguments, but got 1.
|
||||
|
||||
const promise = deleteApi(
|
||||
`domainVerificationToken/${projectId}/domain/${domainId}`
|
||||
);
|
||||
promise.then(
|
||||
function(response) {
|
||||
// @ts-expect-error ts-migrate(2571) FIXME: Object is of type 'unknown'.
|
||||
|
||||
dispatch(deleteProjectDomainSuccess(response.data));
|
||||
// @ts-expect-error ts-migrate(2571) FIXME: Object is of type 'unknown'.
|
||||
|
||||
return response.data;
|
||||
},
|
||||
function(error) {
|
||||
@@ -1065,13 +1065,13 @@ export function verifyProjectDomain({ projectId, domainId }: $TSFixMe) {
|
||||
dispatch(verifyProjectDomainRequest());
|
||||
|
||||
try {
|
||||
// @ts-expect-error ts-migrate(2554) FIXME: Expected 2 arguments, but got 1.
|
||||
|
||||
const response = await putApi(
|
||||
`domainVerificationToken/${projectId}/forceVerify/${domainId}`
|
||||
);
|
||||
// @ts-expect-error ts-migrate(2571) FIXME: Object is of type 'unknown'.
|
||||
|
||||
dispatch(verifyProjectDomainSuccess(response.data));
|
||||
// @ts-expect-error ts-migrate(2571) FIXME: Object is of type 'unknown'.
|
||||
|
||||
return response.data;
|
||||
} catch (error) {
|
||||
const errorMessage =
|
||||
@@ -1117,13 +1117,13 @@ export function unVerifyProjectDomain(projectId: $TSFixMe, domainId: $TSFixMe) {
|
||||
return async function(dispatch: $TSFixMe) {
|
||||
dispatch(unVerifyProjectDomainRequest());
|
||||
|
||||
// @ts-expect-error ts-migrate(2554) FIXME: Expected 2 arguments, but got 1.
|
||||
|
||||
const promise = putApi(
|
||||
`domainVerificationToken/${projectId}/unverify/${domainId}`
|
||||
);
|
||||
promise.then(
|
||||
function(response) {
|
||||
// @ts-expect-error ts-migrate(2571) FIXME: Object is of type 'unknown'.
|
||||
|
||||
dispatch(unVerifyProjectDomainSuccess(response.data));
|
||||
},
|
||||
function(error) {
|
||||
@@ -1171,13 +1171,13 @@ export function resetProjectDomainOnMount() {
|
||||
export function resetProjectDomain(projectId: $TSFixMe, domainId: $TSFixMe) {
|
||||
return async function(dispatch: $TSFixMe) {
|
||||
dispatch(resetProjectDomainRequest());
|
||||
// @ts-expect-error ts-migrate(2554) FIXME: Expected 2 arguments, but got 1.
|
||||
|
||||
const promise = putApi(
|
||||
`domainVerificationToken/${projectId}/resetDomain/${domainId}`
|
||||
);
|
||||
promise.then(
|
||||
function(response) {
|
||||
// @ts-expect-error ts-migrate(2571) FIXME: Object is of type 'unknown'.
|
||||
|
||||
dispatch(resetProjectDomainSuccess(response.data));
|
||||
},
|
||||
function(error) {
|
||||
|
||||
@@ -58,7 +58,7 @@ export const testSmtp = (payload: $TSFixMe) => async (dispatch: $TSFixMe) => {
|
||||
dispatch(testSmtpRequest());
|
||||
|
||||
try {
|
||||
// @ts-expect-error ts-migrate(2554) FIXME: Expected 3 arguments, but got 2.
|
||||
|
||||
const response = await postApi('emailSmtp/test', payload);
|
||||
dispatch(testSmtpSuccess(response));
|
||||
return response;
|
||||
@@ -81,7 +81,7 @@ export const testTwilio = (payload: $TSFixMe) => async (dispatch: $TSFixMe) => {
|
||||
dispatch(testTwilioRequest());
|
||||
|
||||
try {
|
||||
// @ts-expect-error ts-migrate(2554) FIXME: Expected 3 arguments, but got 2.
|
||||
|
||||
const response = await postApi('twilio/sms/test', payload);
|
||||
dispatch(testTwilioSuccess(response));
|
||||
return response;
|
||||
@@ -103,9 +103,9 @@ export const testTwilio = (payload: $TSFixMe) => async (dispatch: $TSFixMe) => {
|
||||
export const fetchSettings = (type: $TSFixMe) => async (dispatch: $TSFixMe) => {
|
||||
dispatch(requestingSettings());
|
||||
try {
|
||||
// @ts-expect-error ts-migrate(2554) FIXME: Expected 2 arguments, but got 1.
|
||||
|
||||
const response = await getApi(`globalConfig/${type}`);
|
||||
// @ts-expect-error ts-migrate(2571) FIXME: Object is of type 'unknown'.
|
||||
|
||||
const data = response.data || { value: {} };
|
||||
if (type === 'smtp') {
|
||||
data.value = { 'smtp-secure': false, ...data.value };
|
||||
@@ -141,12 +141,12 @@ export const saveSettings = (type: $TSFixMe, settings: $TSFixMe) => async (
|
||||
) => {
|
||||
dispatch(requestingSettings());
|
||||
try {
|
||||
// @ts-expect-error ts-migrate(2554) FIXME: Expected 3 arguments, but got 2.
|
||||
|
||||
const response = await postApi(`globalConfig`, {
|
||||
name: type,
|
||||
value: settings,
|
||||
});
|
||||
// @ts-expect-error ts-migrate(2571) FIXME: Object is of type 'unknown'.
|
||||
|
||||
const data = response.data || { value: {} };
|
||||
dispatch(requestingSettingsSucceeded(data.value, type));
|
||||
return response;
|
||||
|
||||
@@ -32,9 +32,9 @@ export const fetchSmsLogs = (skip: $TSFixMe, limit: $TSFixMe) => async (
|
||||
dispatch(fetchSmsLogsRequest());
|
||||
|
||||
try {
|
||||
// @ts-expect-error ts-migrate(2554) FIXME: Expected 2 arguments, but got 1.
|
||||
|
||||
const response = await getApi(`sms-logs?skip=${skip}&limit=${limit}`);
|
||||
// @ts-expect-error ts-migrate(2571) FIXME: Object is of type 'unknown'.
|
||||
|
||||
const data = response.data;
|
||||
|
||||
dispatch(fetchSmsLogsSuccess(data));
|
||||
@@ -89,12 +89,12 @@ export const searchSmsLogs = (
|
||||
dispatch(searchSmsLogsRequest());
|
||||
|
||||
try {
|
||||
// @ts-expect-error ts-migrate(2554) FIXME: Expected 3 arguments, but got 2.
|
||||
|
||||
const response = await postApi(
|
||||
`sms-logs/search?skip=${skip}&limit=${limit}`,
|
||||
values
|
||||
);
|
||||
// @ts-expect-error ts-migrate(2571) FIXME: Object is of type 'unknown'.
|
||||
|
||||
const data = response.data;
|
||||
|
||||
dispatch(searchSmsLogsSuccess(data));
|
||||
@@ -140,9 +140,9 @@ export const deleteSmsLogs = () => async (dispatch: $TSFixMe) => {
|
||||
dispatch(deleteSmsLogsRequest());
|
||||
|
||||
try {
|
||||
// @ts-expect-error ts-migrate(2554) FIXME: Expected 2 arguments, but got 1.
|
||||
|
||||
const response = await deleteApi(`sms-logs`);
|
||||
// @ts-expect-error ts-migrate(2571) FIXME: Object is of type 'unknown'.
|
||||
|
||||
const message = response.data.message;
|
||||
|
||||
dispatch(deleteSmsLogsSuccess(message));
|
||||
@@ -193,13 +193,13 @@ export const resetFetchSmsLogStatus = () => {
|
||||
|
||||
// Calls the API to fetch smsLogStatus
|
||||
export const fetchSmsLogStatus = () => async (dispatch: $TSFixMe) => {
|
||||
// @ts-expect-error ts-migrate(2554) FIXME: Expected 1 arguments, but got 0.
|
||||
|
||||
dispatch(fetchSmsLogStatusRequest());
|
||||
|
||||
try {
|
||||
// @ts-expect-error ts-migrate(2554) FIXME: Expected 2 arguments, but got 1.
|
||||
|
||||
const response = await getApi('globalConfig/smsLogMonitoringStatus');
|
||||
// @ts-expect-error ts-migrate(2571) FIXME: Object is of type 'unknown'.
|
||||
|
||||
dispatch(fetchSmsLogStatusSuccess(response.data));
|
||||
return response;
|
||||
} catch (error) {
|
||||
@@ -252,15 +252,15 @@ export const resetConfirmSmsLogStatus = () => {
|
||||
export const smsLogStatusChange = (values: $TSFixMe) => async (
|
||||
dispatch: $TSFixMe
|
||||
) => {
|
||||
// @ts-expect-error ts-migrate(2554) FIXME: Expected 1 arguments, but got 0.
|
||||
|
||||
dispatch(changeSmsLogStatusRequest());
|
||||
|
||||
try {
|
||||
// @ts-expect-error ts-migrate(2554) FIXME: Expected 3 arguments, but got 2.
|
||||
|
||||
const response = await postApi('globalConfig/', [
|
||||
{ name: 'smsLogMonitoringStatus', value: values.status },
|
||||
]);
|
||||
// @ts-expect-error ts-migrate(2571) FIXME: Object is of type 'unknown'.
|
||||
|
||||
const data = response.data;
|
||||
dispatch(changeSmsLogStatusSuccess(data));
|
||||
return data;
|
||||
|
||||
@@ -29,9 +29,9 @@ export const fetchSsos = (skip: $TSFixMe, limit: $TSFixMe) => async (
|
||||
limit = limit ? parseInt(limit) : 10;
|
||||
dispatch(fetchSsosRequest());
|
||||
try {
|
||||
// @ts-expect-error ts-migrate(2554) FIXME: Expected 2 arguments, but got 1.
|
||||
|
||||
const response = await getApi(`sso/?skip=${skip}&limit=${limit}`);
|
||||
// @ts-expect-error ts-migrate(2571) FIXME: Object is of type 'unknown'.
|
||||
|
||||
dispatch(fetchSsosSuccess(response.data));
|
||||
} catch (error) {
|
||||
let errorMsg;
|
||||
@@ -72,9 +72,9 @@ export const fetchSsoError = (payload: $TSFixMe) => {
|
||||
export const fetchSso = (ssoId: $TSFixMe) => async (dispatch: $TSFixMe) => {
|
||||
dispatch(fetchSsoRequest());
|
||||
try {
|
||||
// @ts-expect-error ts-migrate(2554) FIXME: Expected 2 arguments, but got 1.
|
||||
|
||||
const response = await getApi(`sso/${ssoId}`);
|
||||
// @ts-expect-error ts-migrate(2571) FIXME: Object is of type 'unknown'.
|
||||
|
||||
dispatch(fetchSsoSuccess(response.data));
|
||||
} catch (error) {
|
||||
let errorMsg;
|
||||
@@ -114,7 +114,7 @@ export const deleteSsoError = (payload: $TSFixMe) => {
|
||||
export const deleteSso = (ssoId: $TSFixMe) => async (dispatch: $TSFixMe) => {
|
||||
dispatch(deleteSsoRequest());
|
||||
try {
|
||||
// @ts-expect-error ts-migrate(2554) FIXME: Expected 2 arguments, but got 1.
|
||||
|
||||
await deleteApi(`sso/${ssoId}`);
|
||||
dispatch(deleteSsoSuccess());
|
||||
} catch (error) {
|
||||
@@ -155,7 +155,7 @@ export const addSsoError = (payload: $TSFixMe) => {
|
||||
export const addSso = ({ data }: $TSFixMe) => async (dispatch: $TSFixMe) => {
|
||||
dispatch(addSsoRequest());
|
||||
try {
|
||||
// @ts-expect-error ts-migrate(2554) FIXME: Expected 3 arguments, but got 2.
|
||||
|
||||
await postApi(`sso/`, data);
|
||||
dispatch(addSsoSuccess());
|
||||
} catch (error) {
|
||||
|
||||
@@ -29,11 +29,11 @@ export const fetchSsoDefaultRoles = (skip: $TSFixMe, limit: $TSFixMe) => async (
|
||||
limit = limit ? parseInt(limit) : 10;
|
||||
dispatch(fetchSsoDefaultRolesRequest());
|
||||
try {
|
||||
// @ts-expect-error ts-migrate(2554) FIXME: Expected 2 arguments, but got 1.
|
||||
|
||||
const response = await getApi(
|
||||
`ssoDefaultRoles/?skip=${skip}&limit=${limit}`
|
||||
);
|
||||
// @ts-expect-error ts-migrate(2571) FIXME: Object is of type 'unknown'.
|
||||
|
||||
return dispatch(fetchSsoDefaultRolesSuccess(response.data));
|
||||
} catch (error) {
|
||||
let errorMsg;
|
||||
@@ -76,9 +76,9 @@ export const fetchSsoDefaultRole = (ssoDefaultRoleId: $TSFixMe) => async (
|
||||
) => {
|
||||
dispatch(fetchSsoDefaultRoleRequest());
|
||||
try {
|
||||
// @ts-expect-error ts-migrate(2554) FIXME: Expected 2 arguments, but got 1.
|
||||
|
||||
const response = await getApi(`ssoDefaultRoles/${ssoDefaultRoleId}`);
|
||||
// @ts-expect-error ts-migrate(2571) FIXME: Object is of type 'unknown'.
|
||||
|
||||
dispatch(fetchSsoDefaultRoleSuccess(response.data));
|
||||
} catch (error) {
|
||||
let errorMsg;
|
||||
@@ -121,11 +121,11 @@ export const deleteSsoDefaultRole = (ssoId: $TSFixMe) => async (
|
||||
) => {
|
||||
dispatch(deleteSsoDefaultRoleRequest());
|
||||
try {
|
||||
// @ts-expect-error ts-migrate(2554) FIXME: Expected 2 arguments, but got 1.
|
||||
|
||||
const response = await deleteApi(`ssoDefaultRoles/${ssoId}`);
|
||||
// @ts-expect-error ts-migrate(2571) FIXME: Object is of type 'unknown'.
|
||||
|
||||
dispatch(deleteSsoDefaultRoleSuccess(response.data));
|
||||
// @ts-expect-error ts-migrate(2554) FIXME: Expected 2 arguments, but got 0.
|
||||
|
||||
dispatch(fetchSsoDefaultRoles());
|
||||
} catch (error) {
|
||||
let errorMsg;
|
||||
@@ -167,7 +167,7 @@ export const addSsoDefaultRole = ({ data }: $TSFixMe) => async (
|
||||
) => {
|
||||
dispatch(addSsoDefaultRoleRequest());
|
||||
try {
|
||||
// @ts-expect-error ts-migrate(2554) FIXME: Expected 3 arguments, but got 2.
|
||||
|
||||
await postApi(`ssoDefaultRoles/`, data);
|
||||
dispatch(addSsoDefaultRoleSuccess());
|
||||
return true;
|
||||
|
||||
@@ -31,9 +31,9 @@ export const fetchUsers = (skip: $TSFixMe, limit: $TSFixMe) => async (
|
||||
dispatch(fetchUsersRequest());
|
||||
|
||||
try {
|
||||
// @ts-expect-error ts-migrate(2554) FIXME: Expected 2 arguments, but got 1.
|
||||
|
||||
const response = await getApi(`user/users?skip=${skip}&limit=${limit}`);
|
||||
// @ts-expect-error ts-migrate(2571) FIXME: Object is of type 'unknown'.
|
||||
|
||||
const data = response.data;
|
||||
|
||||
dispatch(fetchUsersSuccess(data));
|
||||
@@ -79,9 +79,9 @@ export const fetchUser = (userId: $TSFixMe) => async (dispatch: $TSFixMe) => {
|
||||
dispatch(fetchUserRequest());
|
||||
|
||||
try {
|
||||
// @ts-expect-error ts-migrate(2554) FIXME: Expected 2 arguments, but got 1.
|
||||
|
||||
const response = await getApi(`user/users/${userId}`);
|
||||
// @ts-expect-error ts-migrate(2571) FIXME: Object is of type 'unknown'.
|
||||
|
||||
const data = response.data;
|
||||
|
||||
dispatch(fetchUserSuccess(data));
|
||||
@@ -134,12 +134,12 @@ export const resetAddUser = () => {
|
||||
export const addUser = (user: $TSFixMe) => async (dispatch: $TSFixMe) => {
|
||||
try {
|
||||
dispatch(addUserRequest());
|
||||
// @ts-expect-error ts-migrate(2554) FIXME: Expected 3 arguments, but got 2.
|
||||
|
||||
const response = await postApi(`user/signup`, user);
|
||||
// @ts-expect-error ts-migrate(2554) FIXME: Expected 2 arguments, but got 1.
|
||||
|
||||
const userResponse = await getApi(`user/users/${response.data.id}`);
|
||||
|
||||
// @ts-expect-error ts-migrate(2571) FIXME: Object is of type 'unknown'.
|
||||
|
||||
dispatch(addUserSuccess(userResponse.data));
|
||||
return 'ok';
|
||||
} catch (error) {
|
||||
@@ -201,7 +201,7 @@ export const updateUserSetting = (values: $TSFixMe) => async (
|
||||
|
||||
try {
|
||||
const response = await putApi(`user/profile/${values._id}`, data);
|
||||
// @ts-expect-error ts-migrate(2571) FIXME: Object is of type 'unknown'.
|
||||
|
||||
const user = response.data;
|
||||
|
||||
dispatch(updateUserSettingSuccess(user));
|
||||
@@ -266,9 +266,9 @@ export const deleteUser = (userId: $TSFixMe) => async (dispatch: $TSFixMe) => {
|
||||
dispatch(deleteUserRequest());
|
||||
|
||||
try {
|
||||
// @ts-expect-error ts-migrate(2554) FIXME: Expected 2 arguments, but got 1.
|
||||
|
||||
const response = await deleteApi(`user/${userId}`);
|
||||
// @ts-expect-error ts-migrate(2571) FIXME: Object is of type 'unknown'.
|
||||
|
||||
const data = response.data;
|
||||
|
||||
dispatch(deleteUserSuccess(data));
|
||||
@@ -321,9 +321,9 @@ export const restoreUser = (userId: $TSFixMe) => async (dispatch: $TSFixMe) => {
|
||||
dispatch(restoreUserRequest());
|
||||
|
||||
try {
|
||||
// @ts-expect-error ts-migrate(2554) FIXME: Expected 2 arguments, but got 1.
|
||||
|
||||
const response = await putApi(`user/${userId}/restoreUser`);
|
||||
// @ts-expect-error ts-migrate(2571) FIXME: Object is of type 'unknown'.
|
||||
|
||||
const data = response.data;
|
||||
|
||||
dispatch(restoreUserSuccess(data));
|
||||
@@ -376,9 +376,9 @@ export const blockUser = (userId: $TSFixMe) => async (dispatch: $TSFixMe) => {
|
||||
dispatch(blockUserRequest());
|
||||
|
||||
try {
|
||||
// @ts-expect-error ts-migrate(2554) FIXME: Expected 2 arguments, but got 1.
|
||||
|
||||
const response = await putApi(`user/${userId}/blockUser`);
|
||||
// @ts-expect-error ts-migrate(2571) FIXME: Object is of type 'unknown'.
|
||||
|
||||
const data = response.data;
|
||||
|
||||
dispatch(blockUserSuccess(data));
|
||||
@@ -433,12 +433,12 @@ export const enableAdminMode = (userId: $TSFixMe, values: $TSFixMe) => async (
|
||||
dispatch(enableAdminModeRequest());
|
||||
|
||||
try {
|
||||
// @ts-expect-error ts-migrate(2554) FIXME: Expected 3 arguments, but got 2.
|
||||
|
||||
const response = await postApi(
|
||||
`user/${userId}/switchToAdminMode`,
|
||||
values
|
||||
);
|
||||
// @ts-expect-error ts-migrate(2571) FIXME: Object is of type 'unknown'.
|
||||
|
||||
const data = response.data;
|
||||
|
||||
dispatch(enableAdminModeSuccess(data));
|
||||
@@ -493,9 +493,9 @@ export const disableAdminMode = (userId: $TSFixMe) => async (
|
||||
dispatch(disableAdminModeRequest());
|
||||
|
||||
try {
|
||||
// @ts-expect-error ts-migrate(2554) FIXME: Expected 3 arguments, but got 1.
|
||||
|
||||
const response = await postApi(`user/${userId}/exitAdminMode`);
|
||||
// @ts-expect-error ts-migrate(2571) FIXME: Object is of type 'unknown'.
|
||||
|
||||
const data = response.data;
|
||||
|
||||
dispatch(disableAdminModeSuccess(data));
|
||||
@@ -548,9 +548,9 @@ export const unblockUser = (userId: $TSFixMe) => async (dispatch: $TSFixMe) => {
|
||||
dispatch(unblockUserRequest());
|
||||
|
||||
try {
|
||||
// @ts-expect-error ts-migrate(2554) FIXME: Expected 2 arguments, but got 1.
|
||||
|
||||
const response = await putApi(`user/${userId}/unblockUser`);
|
||||
// @ts-expect-error ts-migrate(2571) FIXME: Object is of type 'unknown'.
|
||||
|
||||
const data = response.data;
|
||||
|
||||
dispatch(unblockUserSuccess(data));
|
||||
@@ -605,9 +605,9 @@ export const addUserNote = (userId: $TSFixMe, values: $TSFixMe) => async (
|
||||
dispatch(addUserNoteRequest());
|
||||
|
||||
try {
|
||||
// @ts-expect-error ts-migrate(2554) FIXME: Expected 3 arguments, but got 2.
|
||||
|
||||
const response = await postApi(`user/${userId}/addNote`, values);
|
||||
// @ts-expect-error ts-migrate(2571) FIXME: Object is of type 'unknown'.
|
||||
|
||||
const data = response.data;
|
||||
|
||||
dispatch(addUserNoteSuccess(data));
|
||||
@@ -670,12 +670,12 @@ export const searchUsers = (
|
||||
dispatch(searchUsersRequest());
|
||||
|
||||
try {
|
||||
// @ts-expect-error ts-migrate(2554) FIXME: Expected 3 arguments, but got 2.
|
||||
|
||||
const response = await postApi(
|
||||
`user/users/search?skip=${skip}&limit=${limit}`,
|
||||
values
|
||||
);
|
||||
// @ts-expect-error ts-migrate(2571) FIXME: Object is of type 'unknown'.
|
||||
|
||||
const data = response.data;
|
||||
|
||||
dispatch(searchUsersSuccess(data));
|
||||
@@ -723,7 +723,7 @@ export function updateTwoFactorAuthToken(userId: $TSFixMe, data: $TSFixMe) {
|
||||
dispatch(twoFactorAuthTokenRequest());
|
||||
promise.then(
|
||||
function(response) {
|
||||
// @ts-expect-error ts-migrate(2571) FIXME: Object is of type 'unknown'.
|
||||
|
||||
const payload = response.data;
|
||||
dispatch(twoFactorAuthTokenSuccess(payload));
|
||||
return payload;
|
||||
@@ -782,12 +782,12 @@ export function fetchUserloginHistory(
|
||||
limit = 10
|
||||
) {
|
||||
return function(dispatch: $TSFixMe) {
|
||||
// @ts-expect-error ts-migrate(2554) FIXME: Expected 2 arguments, but got 1.
|
||||
|
||||
const promise = getApi(`history/${userId}?skip=${skip}&limit=${limit}`);
|
||||
dispatch(fetchUserHistoryRequest());
|
||||
promise.then(
|
||||
function(response) {
|
||||
// @ts-expect-error ts-migrate(2571) FIXME: Object is of type 'unknown'.
|
||||
|
||||
const payload = response.data;
|
||||
dispatch(fetchUserHistorySuccess(payload));
|
||||
return payload;
|
||||
|
||||
@@ -36,7 +36,7 @@ export function getVersion() {
|
||||
let docsPromise = null;
|
||||
let dashboardPromise = null;
|
||||
|
||||
// @ts-expect-error ts-migrate(2554) FIXME: Expected 2 arguments, but got 1.
|
||||
|
||||
backendPromise = getApi('version');
|
||||
helmChartPromise = getApiHelm('version');
|
||||
docsPromise = getApiDocs('version');
|
||||
@@ -55,7 +55,7 @@ export function getVersion() {
|
||||
function(versions) {
|
||||
let versionsObject = {};
|
||||
versions.forEach(version => {
|
||||
// @ts-expect-error ts-migrate(2571) FIXME: Object is of type 'unknown'.
|
||||
|
||||
versionsObject = { ...versionsObject, ...version.data };
|
||||
});
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ const headers = {
|
||||
|
||||
export function postApi(url: $TSFixMe, data: $TSFixMe, licensing: $TSFixMe) {
|
||||
if (User.isLoggedIn())
|
||||
// @ts-expect-error ts-migrate(7053) FIXME: Element implicitly has an 'any' type because expre... Remove this comment to see the full error message
|
||||
|
||||
headers['Authorization'] = 'Basic ' + User.getAccessToken();
|
||||
const deffered = Q.defer();
|
||||
|
||||
@@ -41,7 +41,7 @@ export function postApi(url: $TSFixMe, data: $TSFixMe, licensing: $TSFixMe) {
|
||||
cookies.remove('admin-data', { path: '/' });
|
||||
cookies.remove('data', { path: '/' });
|
||||
User.clear();
|
||||
// @ts-expect-error ts-migrate(2322) FIXME: Type 'string' is not assignable to type 'Location'... Remove this comment to see the full error message
|
||||
|
||||
window.location = ACCOUNTS_URL + '/login';
|
||||
}
|
||||
if (error && error.response && error.response.data)
|
||||
@@ -56,7 +56,7 @@ export function postApi(url: $TSFixMe, data: $TSFixMe, licensing: $TSFixMe) {
|
||||
|
||||
export function getApi(url: $TSFixMe, licensing: $TSFixMe) {
|
||||
if (User.isLoggedIn())
|
||||
// @ts-expect-error ts-migrate(7053) FIXME: Element implicitly has an 'any' type because expre... Remove this comment to see the full error message
|
||||
|
||||
headers['Authorization'] = 'Basic ' + User.getAccessToken();
|
||||
const deffered = Q.defer();
|
||||
axios({
|
||||
@@ -73,7 +73,7 @@ export function getApi(url: $TSFixMe, licensing: $TSFixMe) {
|
||||
cookies.remove('admin-data', { path: '/' });
|
||||
cookies.remove('data', { path: '/' });
|
||||
User.clear();
|
||||
// @ts-expect-error ts-migrate(2322) FIXME: Type 'string' is not assignable to type 'Location'... Remove this comment to see the full error message
|
||||
|
||||
window.location = ACCOUNTS_URL + '/login';
|
||||
}
|
||||
if (error && error.response && error.response.data)
|
||||
@@ -89,7 +89,7 @@ export function getApi(url: $TSFixMe, licensing: $TSFixMe) {
|
||||
|
||||
export function putApi(url: $TSFixMe, data: $TSFixMe) {
|
||||
if (User.isLoggedIn())
|
||||
// @ts-expect-error ts-migrate(7053) FIXME: Element implicitly has an 'any' type because expre... Remove this comment to see the full error message
|
||||
|
||||
headers['Authorization'] = 'Basic ' + User.getAccessToken();
|
||||
const deffered = Q.defer();
|
||||
axios({
|
||||
@@ -107,7 +107,7 @@ export function putApi(url: $TSFixMe, data: $TSFixMe) {
|
||||
cookies.remove('admin-data', { path: '/' });
|
||||
cookies.remove('data', { path: '/' });
|
||||
User.clear();
|
||||
// @ts-expect-error ts-migrate(2322) FIXME: Type 'string' is not assignable to type 'Location'... Remove this comment to see the full error message
|
||||
|
||||
window.location = ACCOUNTS_URL + '/login';
|
||||
}
|
||||
if (error && error.response && error.response.data)
|
||||
@@ -123,7 +123,7 @@ export function putApi(url: $TSFixMe, data: $TSFixMe) {
|
||||
|
||||
export function deleteApi(url: $TSFixMe, data: $TSFixMe) {
|
||||
if (User.isLoggedIn())
|
||||
// @ts-expect-error ts-migrate(7053) FIXME: Element implicitly has an 'any' type because expre... Remove this comment to see the full error message
|
||||
|
||||
headers['Authorization'] = 'Basic ' + User.getAccessToken();
|
||||
const deffered = Q.defer();
|
||||
axios({
|
||||
@@ -141,7 +141,7 @@ export function deleteApi(url: $TSFixMe, data: $TSFixMe) {
|
||||
cookies.remove('admin-data', { path: '/' });
|
||||
cookies.remove('data', { path: '/' });
|
||||
User.clear();
|
||||
// @ts-expect-error ts-migrate(2322) FIXME: Type 'string' is not assignable to type 'Location'... Remove this comment to see the full error message
|
||||
|
||||
window.location = ACCOUNTS_URL + '/login';
|
||||
}
|
||||
if (error && error.response && error.response.data)
|
||||
@@ -157,7 +157,7 @@ export function deleteApi(url: $TSFixMe, data: $TSFixMe) {
|
||||
|
||||
export function getApiDocs(url: $TSFixMe) {
|
||||
if (User.isLoggedIn())
|
||||
// @ts-expect-error ts-migrate(7053) FIXME: Element implicitly has an 'any' type because expre... Remove this comment to see the full error message
|
||||
|
||||
headers['Authorization'] = 'Basic ' + User.getAccessToken();
|
||||
const deffered = Q.defer();
|
||||
axios({
|
||||
@@ -174,7 +174,7 @@ export function getApiDocs(url: $TSFixMe) {
|
||||
cookies.remove('admin-data', { path: '/' });
|
||||
cookies.remove('data', { path: '/' });
|
||||
User.clear();
|
||||
// @ts-expect-error ts-migrate(2322) FIXME: Type 'string' is not assignable to type 'Location'... Remove this comment to see the full error message
|
||||
|
||||
window.location = ACCOUNTS_URL + '/login';
|
||||
}
|
||||
if (error && error.response && error.response.data)
|
||||
@@ -190,7 +190,7 @@ export function getApiDocs(url: $TSFixMe) {
|
||||
|
||||
export function getApiHelm(url: $TSFixMe) {
|
||||
if (User.isLoggedIn())
|
||||
// @ts-expect-error ts-migrate(7053) FIXME: Element implicitly has an 'any' type because expre... Remove this comment to see the full error message
|
||||
|
||||
headers['Authorization'] = 'Basic ' + User.getAccessToken();
|
||||
const deffered = Q.defer();
|
||||
axios({
|
||||
@@ -207,7 +207,7 @@ export function getApiHelm(url: $TSFixMe) {
|
||||
cookies.remove('admin-data', { path: '/' });
|
||||
cookies.remove('data', { path: '/' });
|
||||
User.clear();
|
||||
// @ts-expect-error ts-migrate(2322) FIXME: Type 'string' is not assignable to type 'Location'... Remove this comment to see the full error message
|
||||
|
||||
window.location = ACCOUNTS_URL + '/login';
|
||||
}
|
||||
if (error && error.response && error.response.data)
|
||||
@@ -223,7 +223,7 @@ export function getApiHelm(url: $TSFixMe) {
|
||||
|
||||
export function getApiDashboard(url: $TSFixMe) {
|
||||
if (User.isLoggedIn())
|
||||
// @ts-expect-error ts-migrate(7053) FIXME: Element implicitly has an 'any' type because expre... Remove this comment to see the full error message
|
||||
|
||||
headers['Authorization'] = 'Basic ' + User.getAccessToken();
|
||||
const deffered = Q.defer();
|
||||
axios({
|
||||
@@ -240,7 +240,7 @@ export function getApiDashboard(url: $TSFixMe) {
|
||||
cookies.remove('admin-data', { path: '/' });
|
||||
cookies.remove('data', { path: '/' });
|
||||
User.clear();
|
||||
// @ts-expect-error ts-migrate(2322) FIXME: Type 'string' is not assignable to type 'Location'... Remove this comment to see the full error message
|
||||
|
||||
window.location = ACCOUNTS_URL + '/login';
|
||||
}
|
||||
if (error && error.response && error.response.data)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { combineReducers } from 'redux';
|
||||
// @ts-expect-error ts-migrate(7016) FIXME: Could not find a declaration file for module 'reac... Remove this comment to see the full error message
|
||||
|
||||
import { routerReducer } from 'react-router-redux';
|
||||
// @ts-expect-error ts-migrate(7016) FIXME: Could not find a declaration file for module 'redu... Remove this comment to see the full error message
|
||||
|
||||
import { reducer as formReducer } from 'redux-form';
|
||||
import modal from './modal';
|
||||
import profileSettings from './profile';
|
||||
|
||||
@@ -39,7 +39,7 @@ export default (state = initialState, action: $TSFixMe) => {
|
||||
const data = {};
|
||||
for (const config of action.payload.data) {
|
||||
const { name, value } = config;
|
||||
// @ts-expect-error ts-migrate(7053) FIXME: Element implicitly has an 'any' type because expre... Remove this comment to see the full error message
|
||||
|
||||
data[name] = value;
|
||||
}
|
||||
return Object.assign({}, state, {
|
||||
@@ -48,11 +48,11 @@ export default (state = initialState, action: $TSFixMe) => {
|
||||
requesting: false,
|
||||
success: true,
|
||||
data: {
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'licenseKey' does not exist on type '{}'.
|
||||
|
||||
license: data.licenseKey,
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'licenseEmail' does not exist on type '{}... Remove this comment to see the full error message
|
||||
|
||||
email: data.licenseEmail,
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'licenseToken' does not exist on type '{}... Remove this comment to see the full error message
|
||||
|
||||
token: data.licenseToken,
|
||||
},
|
||||
},
|
||||
@@ -92,7 +92,7 @@ export default (state = initialState, action: $TSFixMe) => {
|
||||
const data = {};
|
||||
for (const config of action.payload.data) {
|
||||
const { name, value } = config;
|
||||
// @ts-expect-error ts-migrate(7053) FIXME: Element implicitly has an 'any' type because expre... Remove this comment to see the full error message
|
||||
|
||||
data[name] = value;
|
||||
}
|
||||
return Object.assign({}, state, {
|
||||
@@ -101,11 +101,11 @@ export default (state = initialState, action: $TSFixMe) => {
|
||||
requesting: false,
|
||||
success: true,
|
||||
data: {
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'licenseKey' does not exist on type '{}'.
|
||||
|
||||
license: data.licenseKey,
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'licenseEmail' does not exist on type '{}... Remove this comment to see the full error message
|
||||
|
||||
email: data.licenseEmail,
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'licenseToken' does not exist on type '{}... Remove this comment to see the full error message
|
||||
|
||||
token: data.licenseToken,
|
||||
},
|
||||
},
|
||||
|
||||
@@ -15,7 +15,7 @@ export default (state = initialState, action: $TSFixMe) => {
|
||||
case CLOSE_MODAL:
|
||||
return Object.assign({}, state, {
|
||||
modals: state.modals.filter(
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'id' does not exist on type 'never'.
|
||||
|
||||
item => item.id !== action.payload.id
|
||||
),
|
||||
});
|
||||
|
||||
@@ -75,7 +75,7 @@ export default (state = initialState, action: $TSFixMe) => {
|
||||
|
||||
case 'ADD_NOTIFICATION_BY_SOCKET': {
|
||||
const notify = state.notifications.notifications;
|
||||
// @ts-expect-error ts-migrate(2345) FIXME: Argument of type 'any' is not assignable to parame... Remove this comment to see the full error message
|
||||
|
||||
notify.unshift(action.payload);
|
||||
return Object.assign({}, state, {
|
||||
notifications: {
|
||||
@@ -94,12 +94,12 @@ export default (state = initialState, action: $TSFixMe) => {
|
||||
notifications: state.notifications.notifications.map(
|
||||
notification => {
|
||||
if (
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property '_id' does not exist on type 'never'.
|
||||
|
||||
notification._id ===
|
||||
action.payload.notificationId._id
|
||||
) {
|
||||
return {
|
||||
// @ts-expect-error ts-migrate(2698) FIXME: Spread types may only be created from object types... Remove this comment to see the full error message
|
||||
|
||||
...notification,
|
||||
read: notification.read.concat([
|
||||
action.payload.userId,
|
||||
|
||||
@@ -80,10 +80,10 @@ export default function probes(state = initialState, action: $TSFixMe) {
|
||||
probes: {
|
||||
...state.probes,
|
||||
data: state.probes.data.filter(
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property '_id' does not exist on type 'never'.
|
||||
|
||||
d => d._id !== action.payload
|
||||
),
|
||||
// @ts-expect-error ts-migrate(2531) FIXME: Object is possibly 'null'.
|
||||
|
||||
count: state.probes.count - 1,
|
||||
},
|
||||
deleteProbe: {
|
||||
@@ -124,9 +124,9 @@ export default function probes(state = initialState, action: $TSFixMe) {
|
||||
return Object.assign({}, state, {
|
||||
probes: {
|
||||
...state.probes,
|
||||
// @ts-expect-error ts-migrate(2769) FIXME: No overload matches this call.
|
||||
|
||||
data: state.probes.data.concat([action.payload]),
|
||||
// @ts-expect-error ts-migrate(2531) FIXME: Object is possibly 'null'.
|
||||
|
||||
count: state.probes.count + 1,
|
||||
},
|
||||
addProbe: {
|
||||
@@ -198,7 +198,7 @@ export default function probes(state = initialState, action: $TSFixMe) {
|
||||
data:
|
||||
state.probes.data.length > 0
|
||||
? state.probes.data.map(probe => {
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property '_id' does not exist on type 'never'.
|
||||
|
||||
return probe._id === action.payload._id
|
||||
? action.payload
|
||||
: probe;
|
||||
|
||||
@@ -350,7 +350,7 @@ export default function project(state = INITIAL_STATE, action: $TSFixMe) {
|
||||
error: null,
|
||||
success: false,
|
||||
updating: state.updateUser.updating.concat([
|
||||
// @ts-expect-error ts-migrate(2769) FIXME: No overload matches this call.
|
||||
|
||||
action.payload,
|
||||
]),
|
||||
},
|
||||
@@ -612,7 +612,7 @@ export default function project(state = INITIAL_STATE, action: $TSFixMe) {
|
||||
return Object.assign({}, state, {
|
||||
projectTeam: {
|
||||
...state.projectTeam,
|
||||
// @ts-expect-error ts-migrate(2551) FIXME: Property 'page' does not exist on type '{ requesti... Remove this comment to see the full error message
|
||||
|
||||
page: state.projectTeam.page + 1,
|
||||
},
|
||||
});
|
||||
@@ -621,9 +621,9 @@ export default function project(state = INITIAL_STATE, action: $TSFixMe) {
|
||||
projectTeam: {
|
||||
...state.projectTeam,
|
||||
page:
|
||||
// @ts-expect-error ts-migrate(2551) FIXME: Property 'page' does not exist on type '{ requesti... Remove this comment to see the full error message
|
||||
|
||||
state.projectTeam.page > 1
|
||||
? // @ts-expect-error ts-migrate(2551) FIXME: Property 'page' does not exist on type '{ requesti... Remove this comment to see the full error message
|
||||
?
|
||||
state.projectTeam.page - 1
|
||||
: 1,
|
||||
},
|
||||
@@ -638,7 +638,7 @@ export default function project(state = INITIAL_STATE, action: $TSFixMe) {
|
||||
requesting: true,
|
||||
success: false,
|
||||
deleting: state.teamDelete.deleting.concat([
|
||||
// @ts-expect-error ts-migrate(2769) FIXME: No overload matches this call.
|
||||
|
||||
action.payload,
|
||||
]),
|
||||
},
|
||||
@@ -949,9 +949,9 @@ export default function project(state = INITIAL_STATE, action: $TSFixMe) {
|
||||
error: null,
|
||||
success: true,
|
||||
projects: state.projects.projects.map(project => {
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property '_id' does not exist on type 'never'.
|
||||
|
||||
if (project._id === action.payload._id) {
|
||||
// @ts-expect-error ts-migrate(2322) FIXME: Type 'any' is not assignable to type 'never'.
|
||||
|
||||
project = action.payload;
|
||||
}
|
||||
return project;
|
||||
|
||||
@@ -35,13 +35,13 @@ export default function profileSettings(
|
||||
|
||||
case REQUESTING_SETTINGS_SUCCEEDED:
|
||||
if (action.payloadType === 'smtp') {
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'smtp' does not exist on type '{}'.
|
||||
|
||||
settings.smtp = action.payload;
|
||||
} else if (action.payloadType === 'twilio') {
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'twilio' does not exist on type '{}'.
|
||||
|
||||
settings.twilio = action.payload;
|
||||
} else if (action.payloadType === 'sso') {
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'sso' does not exist on type '{}'.
|
||||
|
||||
settings.sso = action.payload;
|
||||
}
|
||||
return {
|
||||
|
||||
@@ -106,7 +106,7 @@ export default function ssoDefaultRoles(
|
||||
ssoDefaultRoles: {
|
||||
...state.ssoDefaultRoles,
|
||||
ssoDefaultRoles: state.ssoDefaultRoles.ssoDefaultRoles.filter(
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property '_id' does not exist on type 'never'.
|
||||
|
||||
element => element._id !== action.payload._id
|
||||
),
|
||||
},
|
||||
|
||||
@@ -220,7 +220,7 @@ export default function user(state = INITIAL_STATE, action: $TSFixMe) {
|
||||
action.payload,
|
||||
...state.users.users.slice(0, -1),
|
||||
],
|
||||
// @ts-expect-error ts-migrate(2531) FIXME: Object is possibly 'null'.
|
||||
|
||||
count: state.users.count + 1,
|
||||
},
|
||||
addUser: {
|
||||
@@ -280,7 +280,7 @@ export default function user(state = INITIAL_STATE, action: $TSFixMe) {
|
||||
error: null,
|
||||
success: true,
|
||||
users: state.users.users.map(user =>
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property '_id' does not exist on type 'never'.
|
||||
|
||||
user._id === action.payload._id ? action.payload : user
|
||||
),
|
||||
count: action.payload.count,
|
||||
@@ -571,9 +571,9 @@ export default function user(state = INITIAL_STATE, action: $TSFixMe) {
|
||||
error: null,
|
||||
success: true,
|
||||
users: state.users.users.map(user => {
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property '_id' does not exist on type 'never'.
|
||||
|
||||
if (user._id === action.payload._id) {
|
||||
// @ts-expect-error ts-migrate(2322) FIXME: Type 'any' is not assignable to type 'never'.
|
||||
|
||||
user = action.payload;
|
||||
}
|
||||
return user;
|
||||
|
||||
@@ -282,12 +282,12 @@ export const allRoutes = groups
|
||||
}
|
||||
return newSubRoutes;
|
||||
})
|
||||
// @ts-expect-error ts-migrate(2345) FIXME: Argument of type '(acc: never[] | undefined, curr:... Remove this comment to see the full error message
|
||||
|
||||
.reduce(joinFn);
|
||||
// @ts-expect-error ts-migrate(2769) FIXME: No overload matches this call.
|
||||
|
||||
return newRoutes.concat(subRoutes);
|
||||
})
|
||||
// @ts-expect-error ts-migrate(2345) FIXME: Argument of type '(acc: never[] | undefined, curr:... Remove this comment to see the full error message
|
||||
|
||||
.reduce(joinFn);
|
||||
|
||||
export const getGroups = () => groups;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { createStore, applyMiddleware, compose } from 'redux';
|
||||
// @ts-expect-error ts-migrate(7016) FIXME: Could not find a declaration file for module 'redu... Remove this comment to see the full error message
|
||||
|
||||
import { createLogger } from 'redux-logger';
|
||||
// @ts-expect-error ts-migrate(7016) FIXME: Could not find a declaration file for module 'reac... Remove this comment to see the full error message
|
||||
|
||||
import { routerMiddleware } from 'react-router-redux';
|
||||
import thunk from 'redux-thunk';
|
||||
import { createBrowserHistory, createMemoryHistory } from 'history';
|
||||
@@ -26,7 +26,7 @@ const middleware = [thunk, routerMiddleware(history)];
|
||||
if (process.env.NODE_ENV === 'development') {
|
||||
let devToolsExtension;
|
||||
if (!isServer) {
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'devToolsExtension' does not exist on typ... Remove this comment to see the full error message
|
||||
|
||||
devToolsExtension = window.devToolsExtension;
|
||||
}
|
||||
middleware.push(logger);
|
||||
|
||||
@@ -16,9 +16,9 @@ export default function(text: $TSFixMe) {
|
||||
// Check if there is any content selected previously
|
||||
// Store selection if found
|
||||
const selected =
|
||||
// @ts-expect-error ts-migrate(2531) FIXME: Object is possibly 'null'.
|
||||
|
||||
document.getSelection().rangeCount > 0
|
||||
? // @ts-expect-error ts-migrate(2531) FIXME: Object is possibly 'null'.
|
||||
?
|
||||
document.getSelection().getRangeAt(0)
|
||||
: false;
|
||||
|
||||
@@ -32,9 +32,9 @@ export default function(text: $TSFixMe) {
|
||||
Unselect everything on the HTML document;
|
||||
Restore the original selection */
|
||||
if (selected) {
|
||||
// @ts-expect-error ts-migrate(2531) FIXME: Object is possibly 'null'.
|
||||
|
||||
document.getSelection().removeAllRanges();
|
||||
// @ts-expect-error ts-migrate(2531) FIXME: Object is possibly 'null'.
|
||||
|
||||
document.getSelection().addRange(selected);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,12 +17,12 @@ process.on('uncaughtException', err => {
|
||||
console.error(err);
|
||||
});
|
||||
|
||||
// @ts-expect-error ts-migrate(7016) FIXME: Could not find a declaration file for module 'expr... Remove this comment to see the full error message
|
||||
|
||||
import express from 'express';
|
||||
const app = express();
|
||||
import path from 'path';
|
||||
import version from './api/version';
|
||||
// @ts-expect-error ts-migrate(7016) FIXME: Could not find a declaration file for module 'cors... Remove this comment to see the full error message
|
||||
|
||||
import cors from 'cors';
|
||||
|
||||
app.use(cors());
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
// @ts-expect-error ts-migrate(2581) FIXME: Cannot find name '$'. Do you need to install type ... Remove this comment to see the full error message
|
||||
|
||||
(function(){"use strict";var e=["curl","ruby","python","php","java","node","go"];$(document).delegate("#language a.language","click",function(this: $TSFixMe, e: $TSFixMe) {var t=$(this);e.preventDefault(),$.isReady||$(document).ready(function(){t.click()})}).ready(function(){function u(n: $TSFixMe){a(function(){for(var r=e.length;r--;)t.removeClass(e[r]);t.addClass(n)})}function a(e: $TSFixMe){s.waypoint("disable"),e(),location.hash&&$(location.hash)[0].scrollIntoView(!0),s.waypoint("enable"),$.waypoints("refresh")}function f(e: $TSFixMe){a(function(){o.find(".switcher a").removeClass("selected"),o.find(".switcher a."+e).addClass("selected"),o.find(".specific-method-example").addClass("hide"),o.find(".specific-method-example."+e).removeClass("hide")})}var t=$("body"),n=$("#api-docs"),r=$("#guide"),i=$("#language"),s=$("#methods a.section-anchor"),o=$(".method-example.cards");n.waypoint(function(){$("body").find("#guide").toggleClass("stick"),$("body").find("#language").toggleClass("stick")}),r.on("click",".section",function(this: $TSFixMe) {r.find(".section.active").removeClass("active"),$(this).addClass("active")}),r.on("click","a.parent, a.child",function(this: $TSFixMe) {r.find("a.viewing").removeClass("viewing"),$(this).addClass("viewing")}),r.on("click","a.parent, a.child",function(){s.waypoint("disable"),setTimeout(function(){s.waypoint("enable")},200)}),o.on("click",".switcher a",function(e: $TSFixMe){e.preventDefault();var t=$(e.currentTarget).attr("class");t.indexOf("selected")===-1&&(f(t),$.cookie("cardType",t,{expires:1825,path:"/",domain:".stripe.com",secure:!0}))}),i.find("a.language").on("click",function(this: $TSFixMe, e: $TSFixMe) {e.preventDefault();var t=$(e.currentTarget).attr("href");window.history&&window.history.replaceState&&history.replaceState({},document.title,t+window.location.hash),i.find("a.selected").removeClass("selected"),$(this).addClass("selected");var n=t.split("https://stripe.com/"),r=n[n.length-1];u(r),$.cookie("lang",r,{expires:1825,path:"/",domain:".stripe.com",secure:!0})}),$("a.show-parameters").on("click",function(e: $TSFixMe){$(e.currentTarget).parent().parent().removeClass("collapsed")}),$(window).trigger("scroll"),s.waypoint({continuous:!1,handler:function(e: $TSFixMe){var t=$(this),n=t.attr("name");window.history&&window.history.replaceState&&history.replaceState({},"","#"+n),$("#guide").find("a[href=#"+n+"], a[data-target~="+n+"]").click()}})})})();
|
||||
@@ -1,2 +1,2 @@
|
||||
// @ts-expect-error ts-migrate(2581) FIXME: Cannot find name '$'. Do you need to install type ... Remove this comment to see the full error message
|
||||
|
||||
(function(){var e="",t: $TSFixMe=null,n={};for(var r=0,i=document.anchors.length;r<i;r++){var s=$(document.anchors[r]),o=s.offset().top,u=document.anchors[r].id;u!=""&&(n[u]=o)}var a=function(){t=null;var r=$(window).scrollTop(),i=Infinity,s;for(var o in n){var u=Math.abs(r-n[o]);u<i&&(s=o,i=u)}s!=e&&(e=s,$("a.flybar-button").each(function(t: $TSFixMe,n: $TSFixMe){n.href=n.href.replace(/(#(.+)?)?$/,"#"+e)}))};$(window).scroll(function(){t!==null&&window.clearTimeout(t),t=window.setTimeout(a,300)}),a()})();
|
||||
@@ -1,2 +1,2 @@
|
||||
// @ts-expect-error ts-migrate(7022) FIXME: '_gaq' implicitly has type 'any' because it does n... Remove this comment to see the full error message
|
||||
|
||||
window.readConfig||(window.readConfig=function(e){function t(e: $TSFixMe){return String(e).replace(/"/g,'"').replace(/'/g,"'").replace(///g,"https://stripe.com/").replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&");}var n=/^[\],:{}\s]*$/,r=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,i=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,s=/(?:^|:|,)(?:\s*\[)+/g,o=document.getElementById(e);if(!o)return null;var u=t((o.textContent||o.innerHTML).replace(/^\s+|\s+$/gm,""));if(n.test(u.replace(r,"@").replace(i,"]").replace(s,"")))return window.JSON&&window.JSON.parse?window.JSON.parse(u):(new Function("return "+u))()});var _gaq=_gaq||[];_gaq.push(["_setAccount","UA-12675062-1"]),_gaq.push(["_setDomainName",".stripe.com"]),_gaq.push(["_trackPageview",document.location.pathname+document.location.search+document.location.hash]),function(){var e=document.createElement("script");e.type="text/javascript",e.async=!0,e.src="../../../stats.g.doubleclick.net/dc.js";var t=document.getElementsByTagName("script")[0];t.parentNode.insertBefore(e,t)}();var google_conversion_id=1008370075,google_custom_params=window.google_tag_params,google_remarketing_only=!0,mpconfig=readConfig("mixpanel_config");(function(e,t){if(!t.__SV){var n,r,i,s;window.mixpanel=t,n=e.createElement("script"),n.type="text/javascript",n.async=!0,n.src="../../../cdn.mxpnl.com/libs/mixpanel-2.2.min.js",r=e.getElementsByTagName("script")[0],r.parentNode.insertBefore(n,r),t._i=[],t.init=function(e: $TSFixMe,n: $TSFixMe,r: $TSFixMe){function o(e: $TSFixMe,t: $TSFixMe){var n=t.split(".");2==n.length&&(e=e[n[0]],t=n[1]),e[t]=function(){e.push([t].concat(Array.prototype.slice.call(arguments,0)))}}var u=t;"undefined"!=typeof r?u=t[r]=[]:r="mixpanel",u.people=u.people||[],u.toString=function(e: $TSFixMe){var t="mixpanel";return"mixpanel"!==r&&(t+="."+r),e||(t+=" (stub)"),t},u.people.toString=function(){return u.toString(1)+".people (stub)"},i="disable track track_pageview track_links track_forms register register_once alias unregister identify name_tag set_config people.set people.increment people.append people.track_charge people.clear_charges people.delete_user".split(" ");for(s=0;s<i.length;s++)o(u,i[s]);t._i.push([e,n,r])},t.__SV=1.2}})(document,[]),mixpanel.init(mpconfig.identifier),mpconfig.disable?mixpanel.disable():(mixpanel.register({merchant:mpconfig.register}),mixpanel.identify(mpconfig.identify),mixpanel.people.set({$email:mpconfig.person}),mixpanel.name_tag(mpconfig.name));var analyticsconfig=readConfig("analytics_config"),Analytics={};Analytics.track=function(e: $TSFixMe,t: $TSFixMe){mixpanel.track(e,t);var n=function(e: $TSFixMe){var t,n,r,i,s,o,u;n=document.cookie.split("; ");for(o=0,u=n.length;o<u;o++){t=n[o],r=t.indexOf("="),i=decodeURIComponent(t.substr(0,r)),s=decodeURIComponent(t.substr(r+1));if(i===e)return s}return null};try{analyticsconfig.merchant?stripeEvent(e,{merchant:analyticsconfig.merchant,user:analyticsconfig.user,cid:n("cid"),data:t}):stripeEvent(e,{cid:n("cid"),data:t})}catch(r){}},Analytics.page=function(e: $TSFixMe){page=window.location.pathname+window.location.search+window.location.hash,page!=="/dashboard"&&page!=="/test/dashboard"&&mixpanel.track(e+".viewed",{page:page})};
|
||||
@@ -1,2 +1,2 @@
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'track' does not exist on type '{}'.
|
||||
|
||||
function footerAnalytics(e: $TSFixMe){e("a[href='https://support.stripe.com/']").click(function(){Analytics.track("header.support.clicked")}),e(window).load(function(){try{analyticsconfig.merchant?makeTrackingRequest({merchant:analyticsconfig.merchant,user:analyticsconfig.user}):makeTrackingRequest()}catch(e){}})}window.$?footerAnalytics($):require(["jquery"],footerAnalytics);
|
||||
@@ -7,18 +7,18 @@ if (typeof String.prototype.startsWith != 'function') {
|
||||
|
||||
function scrollDivToElement(div: $TSFixMe, element: $TSFixMe, moreOffset: $TSFixMe) {
|
||||
var addedPosition = moreOffset ? moreOffset:0;
|
||||
// @ts-expect-error ts-migrate(2304) FIXME: Cannot find name 'firstPosition'.
|
||||
|
||||
firstPosition = div.children().eq(0).offset().top;
|
||||
// @ts-expect-error ts-migrate(2304) FIXME: Cannot find name 'elHeight'.
|
||||
|
||||
elHeight = element.height();
|
||||
// @ts-expect-error ts-migrate(2304) FIXME: Cannot find name 'elPosition'.
|
||||
|
||||
elPosition = element.offset().top;
|
||||
// @ts-expect-error ts-migrate(2304) FIXME: Cannot find name 'elHeight'.
|
||||
|
||||
div.scrollTop(elHeight + elPosition - firstPosition + addedPosition);
|
||||
}
|
||||
// @ts-expect-error ts-migrate(2581) FIXME: Cannot find name '$'. Do you need to install type ... Remove this comment to see the full error message
|
||||
|
||||
$(document).ready(function(){
|
||||
// @ts-expect-error ts-migrate(2581) FIXME: Cannot find name '$'. Do you need to install type ... Remove this comment to see the full error message
|
||||
|
||||
$('#navSelect').change(function(this: $TSFixMe) {
|
||||
var section = this.value.split('-');
|
||||
if(this.value.startsWith('cf-section-')){
|
||||
@@ -30,11 +30,11 @@ $(document).ready(function(){
|
||||
}
|
||||
|
||||
});
|
||||
// @ts-expect-error ts-migrate(2581) FIXME: Cannot find name '$'. Do you need to install type ... Remove this comment to see the full error message
|
||||
|
||||
$('.reference-object').click(function(this: $TSFixMe) {
|
||||
// @ts-expect-error ts-migrate(2581) FIXME: Cannot find name '$'. Do you need to install type ... Remove this comment to see the full error message
|
||||
|
||||
$(this).next('.reference-container').toggleClass('open');
|
||||
// @ts-expect-error ts-migrate(2581) FIXME: Cannot find name '$'. Do you need to install type ... Remove this comment to see the full error message
|
||||
|
||||
$(this).children().children().children('.object-arrow').toggleClass('rotate');
|
||||
});
|
||||
|
||||
@@ -47,25 +47,25 @@ $(document).ready(function(){
|
||||
// languageHeader.css({width: exampleContainerWidth + 'px'});
|
||||
// navigationHeader.css({width: docItemContainerWidth + 'px'});
|
||||
// });
|
||||
// @ts-expect-error ts-migrate(2581) FIXME: Cannot find name '$'. Do you need to install type ... Remove this comment to see the full error message
|
||||
|
||||
$('.dev-doc-item-container').waypoint({
|
||||
handler: function(direction: $TSFixMe) {
|
||||
var elementId = this.element.id;
|
||||
if(elementId.length){
|
||||
// @ts-expect-error ts-migrate(2581) FIXME: Cannot find name '$'. Do you need to install type ... Remove this comment to see the full error message
|
||||
|
||||
var subMenuItem = $('.' + elementId + '.menu-link');
|
||||
var subMenuClass = subMenuItem.attr('title');
|
||||
// @ts-expect-error ts-migrate(2581) FIXME: Cannot find name '$'. Do you need to install type ... Remove this comment to see the full error message
|
||||
|
||||
var categoryItem = $('.doc-category[title="'+ subMenuClass + '"]');
|
||||
// @ts-expect-error ts-migrate(2581) FIXME: Cannot find name '$'. Do you need to install type ... Remove this comment to see the full error message
|
||||
|
||||
$('.menu-link').removeClass('active');
|
||||
subMenuItem.addClass('active');
|
||||
// @ts-expect-error ts-migrate(2581) FIXME: Cannot find name '$'. Do you need to install type ... Remove this comment to see the full error message
|
||||
|
||||
$('.doc-category').removeClass('active');
|
||||
categoryItem.addClass('active');
|
||||
// @ts-expect-error ts-migrate(2581) FIXME: Cannot find name '$'. Do you need to install type ... Remove this comment to see the full error message
|
||||
|
||||
$('.' + elementId + '.doc-category').addClass('active');
|
||||
// @ts-expect-error ts-migrate(2581) FIXME: Cannot find name '$'. Do you need to install type ... Remove this comment to see the full error message
|
||||
|
||||
$('.category-list').removeClass('open');
|
||||
categoryItem.parent().addClass('open');
|
||||
//if(categoryItem.length > 0){
|
||||
@@ -76,21 +76,21 @@ $('.dev-doc-item-container').waypoint({
|
||||
offset: 100
|
||||
});
|
||||
|
||||
// @ts-expect-error ts-migrate(2581) FIXME: Cannot find name '$'. Do you need to install type ... Remove this comment to see the full error message
|
||||
|
||||
$(function() {
|
||||
// @ts-expect-error ts-migrate(2581) FIXME: Cannot find name '$'. Do you need to install type ... Remove this comment to see the full error message
|
||||
|
||||
$('a[href*=#]:not([href=#])').click(function(this: $TSFixMe) {
|
||||
// @ts-expect-error ts-migrate(2581) FIXME: Cannot find name '$'. Do you need to install type ... Remove this comment to see the full error message
|
||||
|
||||
$('.menu-link').removeClass('active');
|
||||
// @ts-expect-error ts-migrate(2581) FIXME: Cannot find name '$'. Do you need to install type ... Remove this comment to see the full error message
|
||||
|
||||
$(this).addClass('active');
|
||||
if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) {
|
||||
// @ts-expect-error ts-migrate(2581) FIXME: Cannot find name '$'. Do you need to install type ... Remove this comment to see the full error message
|
||||
|
||||
var target = $(this.hash);
|
||||
// @ts-expect-error ts-migrate(2581) FIXME: Cannot find name '$'. Do you need to install type ... Remove this comment to see the full error message
|
||||
|
||||
target = target.length ? target : $('[name=' + this.hash.slice(1) +']');
|
||||
if (target.length) {
|
||||
// @ts-expect-error ts-migrate(2581) FIXME: Cannot find name '$'. Do you need to install type ... Remove this comment to see the full error message
|
||||
|
||||
$('html,body').animate({
|
||||
scrollTop: target.offset().top
|
||||
}, 0);
|
||||
@@ -103,10 +103,10 @@ $(function() {
|
||||
var didScroll;
|
||||
var lastScrollTop = 0;
|
||||
var delta = 5;
|
||||
// @ts-expect-error ts-migrate(2581) FIXME: Cannot find name '$'. Do you need to install type ... Remove this comment to see the full error message
|
||||
|
||||
var navBar = $('#languageHeader');
|
||||
var navbarHeight = navBar.outerHeight();
|
||||
// @ts-expect-error ts-migrate(2581) FIXME: Cannot find name '$'. Do you need to install type ... Remove this comment to see the full error message
|
||||
|
||||
$(window).scroll(function(event: $TSFixMe){
|
||||
didScroll = true;
|
||||
});
|
||||
@@ -117,7 +117,7 @@ $(window).scroll(function(event: $TSFixMe){
|
||||
// }
|
||||
//}, 250);
|
||||
function hasScrolled(this: $TSFixMe) {
|
||||
// @ts-expect-error ts-migrate(2581) FIXME: Cannot find name '$'. Do you need to install type ... Remove this comment to see the full error message
|
||||
|
||||
var st = $(this).scrollTop();
|
||||
// Make sure they scroll more than delta
|
||||
if(Math.abs(lastScrollTop - st) <= delta)
|
||||
@@ -130,7 +130,7 @@ function hasScrolled(this: $TSFixMe) {
|
||||
navBar.removeClass('nav-down').addClass('nav-up');
|
||||
} else {
|
||||
// Scroll Up
|
||||
// @ts-expect-error ts-migrate(2581) FIXME: Cannot find name '$'. Do you need to install type ... Remove this comment to see the full error message
|
||||
|
||||
if(st + $(window).height() < $(document).height()) {
|
||||
navBar.removeClass('nav-up').addClass('nav-down');
|
||||
}
|
||||
@@ -159,12 +159,12 @@ function hasScrolled(this: $TSFixMe) {
|
||||
};
|
||||
|
||||
this.push_counter = function(key: $TSFixMe){
|
||||
// @ts-expect-error ts-migrate(7053) FIXME: Element implicitly has an 'any' type because expre... Remove this comment to see the full error message
|
||||
|
||||
if(push_counters[key] === undefined){
|
||||
// @ts-expect-error ts-migrate(7053) FIXME: Element implicitly has an 'any' type because expre... Remove this comment to see the full error message
|
||||
|
||||
push_counters[key] = 0;
|
||||
}
|
||||
// @ts-expect-error ts-migrate(7053) FIXME: Element implicitly has an 'any' type because expre... Remove this comment to see the full error message
|
||||
|
||||
return push_counters[key]++;
|
||||
};
|
||||
|
||||
@@ -206,5 +206,5 @@ function hasScrolled(this: $TSFixMe) {
|
||||
|
||||
return json;
|
||||
};
|
||||
// @ts-expect-error ts-migrate(2304) FIXME: Cannot find name 'jQuery'.
|
||||
|
||||
})(jQuery);
|
||||
File diff suppressed because one or more lines are too long
@@ -1,2 +1,2 @@
|
||||
// @ts-expect-error ts-migrate(2304) FIXME: Cannot find name 'Highlighter'.
|
||||
|
||||
Highlighter={},Highlighter.highlight=function(e: $TSFixMe){$(e).find("span.highlight_js").each(function(e: $TSFixMe,t: $TSFixMe){hljs.highlightBlock(t)})},$(document).ready(function(){Highlighter.highlight(document)});
|
||||
@@ -1,2 +1,2 @@
|
||||
// @ts-expect-error ts-migrate(2304) FIXME: Cannot find name 'define'.
|
||||
|
||||
(function(e){typeof define=="function"&&define.amd?define(["jquery"],e):e(jQuery)})(function(e: $TSFixMe){function n(e: $TSFixMe){return e}function r(e: $TSFixMe){return decodeURIComponent(e.replace(t," "))}function i(e: $TSFixMe){e.indexOf('"')===0&&(e=e.slice(1,-1).replace(/\\"/g,'"').replace(/\\\\/g,"\\"));try{return s.json?JSON.parse(e):e}catch(t){}}var t=/\+/g,s=e.cookie=function(t: $TSFixMe,o: $TSFixMe,u: $TSFixMe){if(o!==undefined){u=e.extend({},s.defaults,u);if(typeof u.expires=="number"){var a=u.expires,f=u.expires=new Date;f.setDate(f.getDate()+a)}return o=s.json?JSON.stringify(o):String(o),document.cookie=[s.raw?t:encodeURIComponent(t),"=",s.raw?o:encodeURIComponent(o),u.expires?"; expires="+u.expires.toUTCString():"",u.path?"; path="+u.path:"",u.domain?"; domain="+u.domain:"",u.secure?"; secure":""].join("")}var l=s.raw?n:r,c=document.cookie.split("; "),h=t?undefined:{};for(var p=0,d=c.length;p<d;p++){var v=c[p].split("="),m=l(v.shift()),g=l(v.join("="));if(t&&t===m){h=i(g);break}t||(h[m]=i(g))}return h};s.defaults={},e.removeCookie=function(t: $TSFixMe,n: $TSFixMe){return e.cookie(t)!==undefined?(e.cookie(t,"",e.extend({},n,{expires:-1})),!0):!1}});
|
||||
File diff suppressed because one or more lines are too long
@@ -1,2 +1,2 @@
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'stripeEvent' does not exist on type 'Win... Remove this comment to see the full error message
|
||||
|
||||
(function(){function e(){return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=Math.random()*16|0,n=e==="x"?t:t&3|8;return n.toString(16)});}function t(e: $TSFixMe){var t,n,r,i,s,o;t=document.cookie.split("; ");for(o=0;o<t.length;o++){n=t[o],r=n.indexOf("="),i=decodeURIComponent(n.substr(0,r)),s=decodeURIComponent(n.substr(r+1));if(i===e)return s}return null}function n(e: $TSFixMe,t: $TSFixMe,n: $TSFixMe){var r,i;n==null&&(n={}),n.expires===!0&&(n.expires=-1),typeof n.expires=="number"&&(r=new Date,r.setTime(r.getTime()+n.expires*24*60*60*1e3),n.expires=r),n.path==null&&(n.path="https://stripe.com/"),t=(t+"").replace(/[^!#-+\--:<-\[\]-~]/g,encodeURIComponent),i=encodeURIComponent(e)+"="+t,n.expires&&(i+=";expires="+n.expires.toGMTString()),n.path&&(i+=";path="+n.path),n.domain&&(i+=";domain="+n.domain),document.cookie=i}function r(){var r;return window.navigator.doNotTrack?"DNT":(r=t("cid")||e(),n("cid",r,{expires:7200,domain:".stripe.com"}),r)}function i(){var t;if(window.navigator.doNotTrack)return"DNT";try{return t=localStorage.getItem("lsid"),t==null&&(t=e(),localStorage.setItem("lsid",t)),t}catch(n){return"NA"}}function s(e: $TSFixMe){var t,n,r;r="";for(t in e)n=e[t],typeof n=="object"&&(n=JSON.stringify(n)),r+="&"+encodeURIComponent(t)+"="+encodeURIComponent(n);return r.replace("&","?")}window.stripeEvent=function(t: $TSFixMe,n: $TSFixMe){n==null&&(n={}),n.event=t,n.cid=r(),n.lsid=i(),(new Image).src="https://q.stripe.com"+s(n)},window.makeTrackingRequest=function(t: $TSFixMe){t==null&&(t={}),t.href=window.location.href,t.referrer=document.referrer,stripeEvent("pageView",{sc:s(t)})}}).call(this);
|
||||
@@ -1,2 +1,2 @@
|
||||
// @ts-expect-error ts-migrate(2581) FIXME: Cannot find name '$'. Do you need to install type ... Remove this comment to see the full error message
|
||||
|
||||
$(document).ready(function(){var e=!!(window&&window.location&&window.location.hostname&&window.location.hostname=="127.0.0.1"),t=function(){var e=document.createElement("div"),t="AnimationName",n=[t],r=["Webkit","Moz","I","ms","Khtml"];for(var i=0;i<r.length;i++)n.push(r[i]+t);for(var i=0;i<n.length;i++){var s=n[i];if(typeof e.style[s]!="undefined")return!0}return!1}(),n: $TSFixMe=null,r=function(){if(n!=null)return n;var e=$("body"),t=e.css("overflow-y");return e.css("overflow-y","scroll"),withScrollbar=$("body").innerWidth(),e.css("overflow-y","hidden"),withoutScrollbar=$("body").innerWidth(),e.css("overflow-y",t),n=withoutScrollbar-withScrollbar,n},i=function(e: $TSFixMe){var t=r();$.browser.msie&&$("html").css("overflow",e?"auto":"hidden"),$("body").css("overflow",e?"auto":"hidden"),$("body").css("margin-right",e?"auto":t)};jQuery.browser.mozilla&&$("body").addClass("mozilla"),$("div.account-dropdown-view a.account").click(function(e: $TSFixMe){e.preventDefault();var t="div.account-dropdown-view",n="click.account_dropdown_view_global_click";$(t).hasClass("shown")?o(t,n):s(t,n)});var s=function(e: $TSFixMe,t: $TSFixMe){$(e).addClass("shown"),setTimeout(function(){$(document).bind(t,o)},100)},o=function(e: $TSFixMe,t: $TSFixMe){$(e).removeClass("shown"),$(document).unbind(t)},u=400,a=$("div.country-dropdown-view"),f=$("a.select",a),l=$("div.country-dropdown-overlay");l.click(function(e: $TSFixMe){i(!0),p.addClass("hide-animation");var n=function(){$("div.country-dropdown-overlay").hide(),p.hide(),p.removeClass("hide-animation"),$(l).off("webkitTransitionEnd"),$(l).off("oTransitionEnd"),$(l).off("transitionend")};$(l).on("webkitTransitionEnd",n),$(l).on("oTransitionEnd",n),$(l).on("transitionend",n),setTimeout(function(){p.removeClass("shown"),l.removeClass("shown")},50),t||setTimeout(n,0)});var c=16,h={width:26,height:17},p=$("div.popover",a),d=!1,v: $TSFixMe;f.mousedown(function(e: $TSFixMe){d=!0,e.preventDefault(),i(!1),l.show();var n=p.outerHeight();p.show(),p.css("top",-(n+c)),p.addClass("show-animation");var r=f.outerWidth();$("div.arrow",p).css("left",20+r/2-h.width/2);var s={x:20+r/2,y:n+(h.height-7)};p.css("-webkit-transform-origin",s.x+"px "+s.y+"px"),p.css("-moz-transform-origin",s.x+"px "+s.y+"px");var o=function(){p.removeClass("show-animation"),$(l).off("webkitTransitionEnd"),$(l).off("oTransitionEnd"),$(l).off("transitionend")};$(l).on("webkitTransitionEnd",o),$(l).on("oTransitionEnd",o),$(l).on("transitionend",o),p.addClass("shown"),l.addClass("shown"),t||setTimeout(o,u)}),$("a",p).hover(function(this: $TSFixMe) {d&&($(this).addClass("hover"),v=$(this))},function(this: $TSFixMe) {$(this).removeClass("hover"),v=null}),$(window).mouseup(function(){d&&v&&setTimeout(function(){window.location.href=v.attr("href")},100),d=!1});if(typeof window["currentPixelRatio"]!="undefined")return;var m=function(){return typeof window["devicePixelRatio"]!="undefined"?window.devicePixelRatio:1};window.currentPixelRatio=m;var g=function(e: $TSFixMe,t: $TSFixMe){if(t==2){var n=e.split(".");return n.length>1&&(n[n.length-2]+="@2x"),n.join(".")}return e.replace("@2x","")};window.hiResURL=g;var y=function(){$("img[data-hires=true]").each(function(this: $TSFixMe) {var e=$(this),t=!0;if(t){var n=e.attr("src");n&&e.attr("src",g(n,m()))}})};y(),typeof window["matchMedia"]!="undefined"&&window.matchMedia("(-webkit-device-pixel-ratio:1)").addListener(y)});
|
||||
File diff suppressed because one or more lines are too long
@@ -27,16 +27,16 @@ process.on('uncaughtException', err => {
|
||||
console.error(err);
|
||||
});
|
||||
|
||||
// @ts-expect-error ts-migrate(7016) FIXME: Could not find a declaration file for module 'expr... Remove this comment to see the full error message
|
||||
|
||||
import express from 'express';
|
||||
const app = express();
|
||||
// @ts-expect-error ts-migrate(2304) FIXME: Cannot find name 'createServer'.
|
||||
|
||||
import http from 'http';
|
||||
http.createServer(app);
|
||||
// @ts-expect-error ts-migrate(7016) FIXME: Could not find a declaration file for module 'cors... Remove this comment to see the full error message
|
||||
|
||||
import cors from 'cors';
|
||||
import Main from './worker/main';
|
||||
// @ts-expect-error ts-migrate(7016) FIXME: Could not find a declaration file for module 'node... Remove this comment to see the full error message
|
||||
|
||||
import cron from 'node-cron';
|
||||
import config from './utils/config';
|
||||
|
||||
@@ -45,7 +45,7 @@ const cronApplicationSecurityStartTime = Math.floor(Math.random() * 50);
|
||||
app.use(cors());
|
||||
app.set('port', process.env.PORT || 3005);
|
||||
|
||||
// @ts-expect-error ts-migrate(7006) FIXME: Parameter 'req' implicitly has an 'any' type.
|
||||
|
||||
app.get(['/application/status', '/status'], function(req, res) {
|
||||
res.setHeader('Content-Type', 'application/json');
|
||||
res.send(
|
||||
@@ -58,7 +58,7 @@ app.get(['/application/status', '/status'], function(req, res) {
|
||||
});
|
||||
|
||||
//App Version
|
||||
// @ts-expect-error ts-migrate(7006) FIXME: Parameter 'req' implicitly has an 'any' type.
|
||||
|
||||
app.get(['/application/version', '/version'], function(req, res) {
|
||||
res.setHeader('Content-Type', 'application/json');
|
||||
res.send({ applicationScannerVersion: process.env.npm_package_version });
|
||||
@@ -71,7 +71,7 @@ cron.schedule('*/5 * * * *', () => {
|
||||
}, cronApplicationSecurityStartTime * 1000);
|
||||
});
|
||||
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'listen' does not exist on type 'typeof i... Remove this comment to see the full error message
|
||||
|
||||
http.listen(app.get('port'), function() {
|
||||
// eslint-disable-next-line
|
||||
console.log(
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// @ts-expect-error ts-migrate(2614) FIXME: Module '"./api"' has no exported member 'postApi'.... Remove this comment to see the full error message
|
||||
|
||||
import { postApi } from './api';
|
||||
|
||||
export default {
|
||||
|
||||
@@ -3,7 +3,7 @@ import EncryptionKeys from './encryptionKeys';
|
||||
const algorithm = EncryptionKeys.algorithm;
|
||||
const key = EncryptionKeys.key;
|
||||
import git from 'simple-git/promise';
|
||||
// @ts-expect-error ts-migrate(7016) FIXME: Could not find a declaration file for module 'uuid... Remove this comment to see the full error message
|
||||
|
||||
import { v1 as uuidv1 } from 'uuid';
|
||||
import Path from 'path';
|
||||
import ErrorService from './errorService';
|
||||
@@ -20,10 +20,10 @@ const {
|
||||
updateApplicationSecurityToFailed,
|
||||
} = require('./applicationSecurityUpdate');
|
||||
|
||||
// @ts-expect-error ts-migrate(7016) FIXME: Could not find a declaration file for module 'ssh2... Remove this comment to see the full error message
|
||||
|
||||
import { Client } from 'ssh2';
|
||||
export default {
|
||||
// @ts-expect-error ts-migrate(7006) FIXME: Parameter 'security' implicitly has an 'any' type.
|
||||
|
||||
scan: async function(security) {
|
||||
if (
|
||||
security.gitCredential.gitUsername &&
|
||||
@@ -39,7 +39,7 @@ export default {
|
||||
await this.sshScanApplicationSecurity(security);
|
||||
}
|
||||
},
|
||||
// @ts-expect-error ts-migrate(7006) FIXME: Parameter 'security' implicitly has an 'any' type.
|
||||
|
||||
decryptPassword: async function(security) {
|
||||
try {
|
||||
const values = [];
|
||||
@@ -60,11 +60,11 @@ export default {
|
||||
throw error;
|
||||
}
|
||||
},
|
||||
// @ts-expect-error ts-migrate(7006) FIXME: Parameter 'encText' implicitly has an 'any' type.
|
||||
|
||||
decrypt: (encText, iv) => {
|
||||
const promise = new Promise((resolve, reject) => {
|
||||
try {
|
||||
// @ts-expect-error ts-migrate(2769) FIXME: No overload matches this call.
|
||||
|
||||
const decipher = crypto.createDecipheriv(algorithm, key, iv);
|
||||
let decoded = decipher.update(encText, 'hex', 'utf8');
|
||||
decoded += decipher.final('utf8');
|
||||
@@ -75,11 +75,11 @@ export default {
|
||||
});
|
||||
return promise;
|
||||
},
|
||||
// @ts-expect-error ts-migrate(7006) FIXME: Parameter 'security' implicitly has an 'any' type.
|
||||
|
||||
sshScanApplicationSecurity: async security => {
|
||||
try {
|
||||
let securityDir = 'application_security_dir';
|
||||
// @ts-expect-error ts-migrate(2322) FIXME: Type 'unknown' is not assignable to type 'string'.
|
||||
|
||||
securityDir = await createDir(securityDir);
|
||||
const cloneDirectory = `${uuidv1()}security`; // always create unique paths
|
||||
const repoPath = Path.resolve(securityDir, cloneDirectory);
|
||||
@@ -101,7 +101,7 @@ export default {
|
||||
cwd: repoPath,
|
||||
});
|
||||
output.on('error', error => {
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'code' does not exist on type 'Error'.
|
||||
|
||||
error.code = 500;
|
||||
throw error;
|
||||
});
|
||||
@@ -117,7 +117,7 @@ export default {
|
||||
);
|
||||
|
||||
audit.on('error', error => {
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'code' does not exist on type 'Error'.
|
||||
|
||||
error.code = 500;
|
||||
throw error;
|
||||
});
|
||||
@@ -130,21 +130,21 @@ export default {
|
||||
audit.on('close', async () => {
|
||||
let advisories = [];
|
||||
auditOutput = JSON.parse(auditOutput); // parse the stringified json
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'vulnerabilities' does not exist on type ... Remove this comment to see the full error message
|
||||
|
||||
for (const key in auditOutput.vulnerabilities) {
|
||||
advisories.push(
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'vulnerabilities' does not exist on type ... Remove this comment to see the full error message
|
||||
|
||||
auditOutput.vulnerabilities[key]
|
||||
);
|
||||
}
|
||||
|
||||
// @ts-expect-error ts-migrate(7034) FIXME: Variable 'criticalArr' implicitly has type 'any[]'... Remove this comment to see the full error message
|
||||
|
||||
const criticalArr = [],
|
||||
// @ts-expect-error ts-migrate(7034) FIXME: Variable 'highArr' implicitly has type 'any[]' in ... Remove this comment to see the full error message
|
||||
|
||||
highArr = [],
|
||||
// @ts-expect-error ts-migrate(7034) FIXME: Variable 'moderateArr' implicitly has type 'any[]'... Remove this comment to see the full error message
|
||||
|
||||
moderateArr = [],
|
||||
// @ts-expect-error ts-migrate(7034) FIXME: Variable 'lowArr' implicitly has type 'any[]' in s... Remove this comment to see the full error message
|
||||
|
||||
lowArr = [];
|
||||
advisories.map(advisory => {
|
||||
if (advisory.severity === 'critical') {
|
||||
@@ -164,34 +164,34 @@ export default {
|
||||
|
||||
// restructure advisories from the most critical case to the least critical(low)
|
||||
advisories = [
|
||||
// @ts-expect-error ts-migrate(7005) FIXME: Variable 'criticalArr' implicitly has an 'any[]' t... Remove this comment to see the full error message
|
||||
|
||||
...criticalArr,
|
||||
// @ts-expect-error ts-migrate(7005) FIXME: Variable 'highArr' implicitly has an 'any[]' type.
|
||||
|
||||
...highArr,
|
||||
// @ts-expect-error ts-migrate(7005) FIXME: Variable 'moderateArr' implicitly has an 'any[]' t... Remove this comment to see the full error message
|
||||
|
||||
...moderateArr,
|
||||
// @ts-expect-error ts-migrate(7005) FIXME: Variable 'lowArr' implicitly has an 'any[]' type.
|
||||
|
||||
...lowArr,
|
||||
];
|
||||
|
||||
const auditData = {
|
||||
dependencies:
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'metadata' does not exist on type 'string... Remove this comment to see the full error message
|
||||
|
||||
auditOutput.metadata.dependencies,
|
||||
devDependencies:
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'metadata' does not exist on type 'string... Remove this comment to see the full error message
|
||||
|
||||
auditOutput.metadata
|
||||
.devDependencies,
|
||||
optionalDependencies:
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'metadata' does not exist on type 'string... Remove this comment to see the full error message
|
||||
|
||||
auditOutput.metadata
|
||||
.optionalDependencies,
|
||||
totalDependencies:
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'metadata' does not exist on type 'string... Remove this comment to see the full error message
|
||||
|
||||
auditOutput.metadata
|
||||
.totalDependencies,
|
||||
vulnerabilities:
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'metadata' does not exist on type 'string... Remove this comment to see the full error message
|
||||
|
||||
auditOutput.metadata
|
||||
.vulnerabilities,
|
||||
advisories,
|
||||
@@ -240,11 +240,11 @@ export default {
|
||||
throw error;
|
||||
}
|
||||
},
|
||||
// @ts-expect-error ts-migrate(7006) FIXME: Parameter 'security' implicitly has an 'any' type.
|
||||
|
||||
scanApplicationSecurity: async security => {
|
||||
try {
|
||||
let securityDir = 'application_security_dir';
|
||||
// @ts-expect-error ts-migrate(2322) FIXME: Type 'unknown' is not assignable to type 'string'.
|
||||
|
||||
securityDir = await createDir(securityDir);
|
||||
|
||||
const USER = security.gitCredential.gitUsername;
|
||||
@@ -269,7 +269,7 @@ export default {
|
||||
cwd: repoPath,
|
||||
});
|
||||
output.on('error', error => {
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'code' does not exist on type 'Error'.
|
||||
|
||||
error.code = 500;
|
||||
throw error;
|
||||
});
|
||||
@@ -281,7 +281,7 @@ export default {
|
||||
});
|
||||
|
||||
audit.on('error', error => {
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'code' does not exist on type 'Error'.
|
||||
|
||||
error.code = 500;
|
||||
throw error;
|
||||
});
|
||||
@@ -294,21 +294,21 @@ export default {
|
||||
audit.on('close', async () => {
|
||||
let advisories = [];
|
||||
auditOutput = JSON.parse(auditOutput); // parse the stringified json
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'vulnerabilities' does not exist on type ... Remove this comment to see the full error message
|
||||
|
||||
for (const key in auditOutput.vulnerabilities) {
|
||||
advisories.push(
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'vulnerabilities' does not exist on type ... Remove this comment to see the full error message
|
||||
|
||||
auditOutput.vulnerabilities[key]
|
||||
);
|
||||
}
|
||||
|
||||
// @ts-expect-error ts-migrate(7034) FIXME: Variable 'criticalArr' implicitly has type 'any[]'... Remove this comment to see the full error message
|
||||
|
||||
const criticalArr = [],
|
||||
// @ts-expect-error ts-migrate(7034) FIXME: Variable 'highArr' implicitly has type 'any[]' in ... Remove this comment to see the full error message
|
||||
|
||||
highArr = [],
|
||||
// @ts-expect-error ts-migrate(7034) FIXME: Variable 'moderateArr' implicitly has type 'any[]'... Remove this comment to see the full error message
|
||||
|
||||
moderateArr = [],
|
||||
// @ts-expect-error ts-migrate(7034) FIXME: Variable 'lowArr' implicitly has type 'any[]' in s... Remove this comment to see the full error message
|
||||
|
||||
lowArr = [];
|
||||
advisories.map(advisory => {
|
||||
if (advisory.severity === 'critical') {
|
||||
@@ -328,32 +328,32 @@ export default {
|
||||
|
||||
// restructure advisories from the most critical case to the least critical(low)
|
||||
advisories = [
|
||||
// @ts-expect-error ts-migrate(7005) FIXME: Variable 'criticalArr' implicitly has an 'any[]' t... Remove this comment to see the full error message
|
||||
|
||||
...criticalArr,
|
||||
// @ts-expect-error ts-migrate(7005) FIXME: Variable 'highArr' implicitly has an 'any[]' type.
|
||||
|
||||
...highArr,
|
||||
// @ts-expect-error ts-migrate(7005) FIXME: Variable 'moderateArr' implicitly has an 'any[]' t... Remove this comment to see the full error message
|
||||
|
||||
...moderateArr,
|
||||
// @ts-expect-error ts-migrate(7005) FIXME: Variable 'lowArr' implicitly has an 'any[]' type.
|
||||
|
||||
...lowArr,
|
||||
];
|
||||
|
||||
const auditData = {
|
||||
dependencies:
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'metadata' does not exist on type 'string... Remove this comment to see the full error message
|
||||
|
||||
auditOutput.metadata.dependencies,
|
||||
devDependencies:
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'metadata' does not exist on type 'string... Remove this comment to see the full error message
|
||||
|
||||
auditOutput.metadata.devDependencies,
|
||||
optionalDependencies:
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'metadata' does not exist on type 'string... Remove this comment to see the full error message
|
||||
|
||||
auditOutput.metadata
|
||||
.optionalDependencies,
|
||||
totalDependencies:
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'metadata' does not exist on type 'string... Remove this comment to see the full error message
|
||||
|
||||
auditOutput.metadata.totalDependencies,
|
||||
vulnerabilities:
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'metadata' does not exist on type 'string... Remove this comment to see the full error message
|
||||
|
||||
auditOutput.metadata.vulnerabilities,
|
||||
advisories,
|
||||
};
|
||||
@@ -395,7 +395,7 @@ export default {
|
||||
}
|
||||
},
|
||||
};
|
||||
// @ts-expect-error ts-migrate(7006) FIXME: Parameter 'dir' implicitly has an 'any' type.
|
||||
|
||||
async function deleteFolderRecursive(dir) {
|
||||
if (fs.existsSync(dir)) {
|
||||
const entries = await readdir(dir, { withFileTypes: true });
|
||||
@@ -410,7 +410,7 @@ async function deleteFolderRecursive(dir) {
|
||||
await rmdir(dir); // finally remove now empty directory
|
||||
}
|
||||
}
|
||||
// @ts-expect-error ts-migrate(7006) FIXME: Parameter 'url' implicitly has an 'any' type.
|
||||
|
||||
function formatUrl(url) {
|
||||
// remove https://www. from url
|
||||
if (url.indexOf('https://www.') === 0) {
|
||||
@@ -436,7 +436,7 @@ function formatUrl(url) {
|
||||
return url;
|
||||
}
|
||||
|
||||
// @ts-expect-error ts-migrate(7006) FIXME: Parameter 'dirPath' implicitly has an 'any' type.
|
||||
|
||||
function createDir(dirPath) {
|
||||
return new Promise((resolve, reject) => {
|
||||
const workPath = Path.resolve(process.cwd(), dirPath);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// @ts-expect-error ts-migrate(2732) FIXME: Cannot find module '../package.json'. Consider usi... Remove this comment to see the full error message
|
||||
|
||||
import packageJson from '../package.json';
|
||||
|
||||
const COMMAND = {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import winston from 'winston';
|
||||
// @ts-expect-error ts-migrate(7016) FIXME: Could not find a declaration file for module 'wins... Remove this comment to see the full error message
|
||||
|
||||
import Slack from 'winston-slack-transport';
|
||||
|
||||
if (
|
||||
@@ -7,7 +7,7 @@ if (
|
||||
process.env.SLACK_ERROR_LOG_WEBHOOK &&
|
||||
process.env.SLACK_ERROR_LOG_CHANNEL
|
||||
) {
|
||||
// @ts-expect-error ts-migrate(2554) FIXME: Expected 1 arguments, but got 2.
|
||||
|
||||
winston.add(Slack, {
|
||||
webhook_url: process.env.SLACK_ERROR_LOG_WEBHOOK,
|
||||
channel: '#' + process.env.SLACK_ERROR_LOG_CHANNEL,
|
||||
@@ -26,7 +26,7 @@ export default {
|
||||
functionName: String(functionName),
|
||||
stack: new Error().stack,
|
||||
},
|
||||
// @ts-expect-error ts-migrate(2769) FIXME: No overload matches this call.
|
||||
|
||||
0,
|
||||
2
|
||||
)
|
||||
|
||||
@@ -6,7 +6,7 @@ import path from 'path';
|
||||
import fs from 'fs';
|
||||
|
||||
const router = express.Router();
|
||||
// @ts-expect-error ts-migrate(2614) FIXME: Module '"../middlewares/authorization"' has no exp... Remove this comment to see the full error message
|
||||
|
||||
import { isAuthorized } from '../middlewares/authorization';
|
||||
const getUser = require('../middlewares/user').getUser;
|
||||
const getSubProjects = require('../middlewares/subProject').getSubProjects;
|
||||
@@ -19,7 +19,7 @@ const sendItemResponse = require('../middlewares/response').sendItemResponse;
|
||||
router.post('/:projectId', getUser, isAuthorized, async function(req, res) {
|
||||
try {
|
||||
const projectId = req.params.projectId;
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'user' does not exist on type 'Request<{ ... Remove this comment to see the full error message
|
||||
|
||||
const userId = req.user.id;
|
||||
const data = req.body;
|
||||
data.projectId = projectId;
|
||||
@@ -43,9 +43,9 @@ router.get('/:projectId', getUser, isAuthorized, getSubProjects, async function(
|
||||
res
|
||||
) {
|
||||
try {
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'user' does not exist on type 'Request<{ ... Remove this comment to see the full error message
|
||||
|
||||
const subProjectIds = req.user.subProjects
|
||||
? // @ts-expect-error ts-migrate(2339) FIXME: Property 'user' does not exist on type 'Request<{ ... Remove this comment to see the full error message
|
||||
?
|
||||
req.user.subProjects.map((project: $TSFixMe) => project._id)
|
||||
: null;
|
||||
const alerts = await alertService.getSubProjectAlerts(subProjectIds);
|
||||
@@ -168,7 +168,7 @@ router.get('/:projectId/:alertId/viewed', async function(req, res) {
|
||||
router.delete('/:projectId', getUser, isUserOwner, async function(req, res) {
|
||||
try {
|
||||
const projectId = req.params.projectId;
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'user' does not exist on type 'Request<{ ... Remove this comment to see the full error message
|
||||
|
||||
const userId = req.user.id;
|
||||
const alert = await alertService.deleteBy(
|
||||
{ projectId: projectId },
|
||||
|
||||
@@ -56,14 +56,14 @@ router.get('/', async (req, res) => {
|
||||
|
||||
// handle redis related operation to test the health
|
||||
try {
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'redisClient' does not exist on type 'Glo... Remove this comment to see the full error message
|
||||
|
||||
if (global.redisClient) {
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'redisClient' does not exist on type 'Glo... Remove this comment to see the full error message
|
||||
|
||||
await global.redisClient.set(
|
||||
'status',
|
||||
'Redis status is online'
|
||||
);
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'redisClient' does not exist on type 'Glo... Remove this comment to see the full error message
|
||||
|
||||
const value = await global.redisClient.get('status');
|
||||
|
||||
if (!value) {
|
||||
|
||||
@@ -12,14 +12,14 @@ const getUser = require('../middlewares/user').getUser;
|
||||
const isApplicationLogValid = require('../middlewares/applicationLog')
|
||||
.isApplicationLogValid;
|
||||
|
||||
// @ts-expect-error ts-migrate(2614) FIXME: Module '"../middlewares/authorization"' has no exp... Remove this comment to see the full error message
|
||||
|
||||
import { isAuthorized } from '../middlewares/authorization';
|
||||
const sendErrorResponse = require('../middlewares/response').sendErrorResponse;
|
||||
const sendItemResponse = require('../middlewares/response').sendItemResponse;
|
||||
const sendListResponse = require('../middlewares/response').sendListResponse;
|
||||
const isUserAdmin = require('../middlewares/project').isUserAdmin;
|
||||
import ResourceCategoryService from '../services/resourceCategoryService';
|
||||
// @ts-expect-error ts-migrate(7016) FIXME: Could not find a declaration file for module 'uuid... Remove this comment to see the full error message
|
||||
|
||||
import uuid from 'uuid';
|
||||
|
||||
// Route
|
||||
@@ -42,7 +42,7 @@ router.post(
|
||||
message: "values can't be null",
|
||||
});
|
||||
}
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'user' does not exist on type 'Request<{ ... Remove this comment to see the full error message
|
||||
|
||||
data.createdById = req.user ? req.user.id : null;
|
||||
if (!data.name) {
|
||||
return sendErrorResponse(req, res, {
|
||||
@@ -73,17 +73,17 @@ router.post(
|
||||
populate: populateComponent,
|
||||
}),
|
||||
UserService.findOneBy({
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'user' does not exist on type 'Request<{ ... Remove this comment to see the full error message
|
||||
|
||||
query: { _id: req.user.id },
|
||||
select: 'name _id',
|
||||
}),
|
||||
]);
|
||||
|
||||
try {
|
||||
// @ts-expect-error ts-migrate(2554) FIXME: Expected 5 arguments, but got 4.
|
||||
|
||||
NotificationService.create(
|
||||
component.projectId._id,
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'name' does not exist on type 'Document<a... Remove this comment to see the full error message
|
||||
|
||||
`A New Application Log was Created with name ${applicationLog.name} by ${user.name}`,
|
||||
user._id,
|
||||
'applicationlogaddremove'
|
||||
@@ -143,7 +143,7 @@ router.delete(
|
||||
_id: applicationLogId,
|
||||
componentId: componentId,
|
||||
},
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'user' does not exist on type 'Request<{ ... Remove this comment to see the full error message
|
||||
|
||||
req.user.id
|
||||
);
|
||||
if (applicationLog) {
|
||||
@@ -215,18 +215,18 @@ router.post(
|
||||
|
||||
const query = {};
|
||||
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'applicationLogId' does not exist on type... Remove this comment to see the full error message
|
||||
|
||||
if (applicationLogId) query.applicationLogId = applicationLogId;
|
||||
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'type' does not exist on type '{}'.
|
||||
|
||||
if (type) query.type = type;
|
||||
|
||||
if (startDate && endDate)
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'createdAt' does not exist on type '{}'.
|
||||
|
||||
query.createdAt = { $gte: startDate, $lte: endDate };
|
||||
|
||||
if (filter) {
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'stringifiedContent' does not exist on ty... Remove this comment to see the full error message
|
||||
|
||||
query.stringifiedContent = {
|
||||
$regex: new RegExp(filter),
|
||||
$options: 'i',
|
||||
@@ -278,7 +278,7 @@ router.post(
|
||||
|
||||
const query = {};
|
||||
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'applicationLogId' does not exist on type... Remove this comment to see the full error message
|
||||
|
||||
if (applicationLogId) query.applicationLogId = applicationLogId;
|
||||
|
||||
const stat = {};
|
||||
@@ -294,13 +294,13 @@ router.post(
|
||||
LogService.countBy({ ...query, type: 'info' }),
|
||||
LogService.countBy({ ...query, type: 'warning' }),
|
||||
]);
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'all' does not exist on type '{}'.
|
||||
|
||||
stat.all = allCount;
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'error' does not exist on type '{}'.
|
||||
|
||||
stat.error = errorCount;
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'info' does not exist on type '{}'.
|
||||
|
||||
stat.info = infoCount;
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'warning' does not exist on type '{}'.
|
||||
|
||||
stat.warning = warningCount;
|
||||
|
||||
return sendListResponse(req, res, stat);
|
||||
@@ -363,7 +363,7 @@ router.put(
|
||||
message: "values can't be null",
|
||||
});
|
||||
}
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'user' does not exist on type 'Request<{ ... Remove this comment to see the full error message
|
||||
|
||||
data.createdById = req.user ? req.user.id : null;
|
||||
|
||||
if (!data.name && data.showQuickStart === undefined) {
|
||||
@@ -391,7 +391,7 @@ router.put(
|
||||
};
|
||||
|
||||
if (data.resourceCategory != '') {
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'resourceCategory' does not exist on type... Remove this comment to see the full error message
|
||||
|
||||
existingQuery.resourceCategory = data.resourceCategory;
|
||||
}
|
||||
const existingApplicationCount = await ApplicationLogService.countBy(
|
||||
@@ -412,11 +412,11 @@ router.put(
|
||||
// application Log is valid
|
||||
const applicationLogUpdate = {};
|
||||
if (data.name) {
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'name' does not exist on type '{}'.
|
||||
|
||||
applicationLogUpdate.name = data.name;
|
||||
}
|
||||
if (data.showQuickStart !== undefined) {
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'showQuickStart' does not exist on type '... Remove this comment to see the full error message
|
||||
|
||||
applicationLogUpdate.showQuickStart = data.showQuickStart;
|
||||
}
|
||||
|
||||
@@ -430,7 +430,7 @@ router.put(
|
||||
}
|
||||
);
|
||||
if (resourceCategoryCount && resourceCategoryCount > 0) {
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'resourceCategory' does not exist on type... Remove this comment to see the full error message
|
||||
|
||||
applicationLogUpdate.resourceCategory = data.resourceCategory;
|
||||
} else {
|
||||
unsetData = { resourceCategory: '' };
|
||||
@@ -441,7 +441,7 @@ router.put(
|
||||
const applicationLog = await ApplicationLogService.updateOneBy(
|
||||
{ _id: currentApplicationLog._id },
|
||||
applicationLogUpdate,
|
||||
// @ts-expect-error ts-migrate(2345) FIXME: Argument of type '{ resourceCategory: string; } | ... Remove this comment to see the full error message
|
||||
|
||||
unsetData
|
||||
);
|
||||
return sendItemResponse(req, res, applicationLog);
|
||||
@@ -462,7 +462,7 @@ router.post(
|
||||
const endTime = new Date(startTime.getTime() + duration * 60000);
|
||||
let response;
|
||||
if (filter) {
|
||||
// @ts-expect-error ts-migrate(2554) FIXME: Expected 4 arguments, but got 2.
|
||||
|
||||
response = await LogService.search(
|
||||
{ applicationLogId, deleted: false },
|
||||
filter
|
||||
|
||||
@@ -92,15 +92,15 @@ router.post('/log', isAuthorizedApplicationScanner, async function(req, res) {
|
||||
const selectApplicationSecurityLog = '_id securityId componentId data';
|
||||
|
||||
const findLog = await ApplicationSecurityLogService.findOneBy({
|
||||
// @ts-expect-error ts-migrate(2571) FIXME: Object is of type 'unknown'.
|
||||
|
||||
query: { _id: securityLog._id },
|
||||
populate: populateApplicationSecurityLog,
|
||||
select: selectApplicationSecurityLog,
|
||||
});
|
||||
|
||||
// @ts-expect-error ts-migrate(2345) FIXME: Argument of type '{ query: { _id: any; }; select: ... Remove this comment to see the full error message
|
||||
|
||||
const project = await ProjectService.findOneBy({
|
||||
// @ts-expect-error ts-migrate(2571) FIXME: Object is of type 'unknown'.
|
||||
|
||||
query: { _id: findLog.componentId.projectId },
|
||||
select: '_id name users',
|
||||
});
|
||||
@@ -110,28 +110,28 @@ router.post('/log', isAuthorizedApplicationScanner, async function(req, res) {
|
||||
.map((e: $TSFixMe) => ({
|
||||
id: e.userId,
|
||||
})); // This cater for projects with multiple registered members
|
||||
// @ts-expect-error ts-migrate(2571) FIXME: Object is of type 'unknown'.
|
||||
|
||||
project.critical = findLog.data.vulnerabilities.critical;
|
||||
// @ts-expect-error ts-migrate(2571) FIXME: Object is of type 'unknown'.
|
||||
|
||||
project.high = findLog.data.vulnerabilities.high;
|
||||
// @ts-expect-error ts-migrate(2571) FIXME: Object is of type 'unknown'.
|
||||
|
||||
project.moderate = findLog.data.vulnerabilities.moderate;
|
||||
// @ts-expect-error ts-migrate(2571) FIXME: Object is of type 'unknown'.
|
||||
|
||||
project.low = findLog.data.vulnerabilities.low;
|
||||
|
||||
// @ts-expect-error ts-migrate(2571) FIXME: Object is of type 'unknown'.
|
||||
|
||||
const critical = findLog.data.advisories
|
||||
.filter((e: $TSFixMe) => e.severity === 'critical')
|
||||
.slice(0, 10);
|
||||
// @ts-expect-error ts-migrate(2571) FIXME: Object is of type 'unknown'.
|
||||
|
||||
const high = findLog.data.advisories
|
||||
.filter((e: $TSFixMe) => e.severity === 'high')
|
||||
.slice(0, 10);
|
||||
// @ts-expect-error ts-migrate(2571) FIXME: Object is of type 'unknown'.
|
||||
|
||||
const moderate = findLog.data.advisories
|
||||
.filter((e: $TSFixMe) => e.severity === 'moderate')
|
||||
.slice(0, 10);
|
||||
// @ts-expect-error ts-migrate(2571) FIXME: Object is of type 'unknown'.
|
||||
|
||||
const low = findLog.data.advisories
|
||||
.filter((e: $TSFixMe) => e.severity === 'low')
|
||||
.slice(0, 10);
|
||||
@@ -251,7 +251,7 @@ router.post('/log', isAuthorizedApplicationScanner, async function(req, res) {
|
||||
|
||||
try {
|
||||
RealtimeService.handleLog({
|
||||
// @ts-expect-error ts-migrate(2571) FIXME: Object is of type 'unknown'.
|
||||
|
||||
securityId: securityLog.securityId,
|
||||
securityLog: findLog,
|
||||
});
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import express from 'express';
|
||||
const getUser = require('../middlewares/user').getUser;
|
||||
// @ts-expect-error ts-migrate(2614) FIXME: Module '"../middlewares/authorization"' has no exp... Remove this comment to see the full error message
|
||||
|
||||
import { isAuthorized } from '../middlewares/authorization';
|
||||
const sendErrorResponse = require('../middlewares/response').sendErrorResponse;
|
||||
const sendItemResponse = require('../middlewares/response').sendItemResponse;
|
||||
@@ -104,17 +104,17 @@ router.put(
|
||||
const data = {};
|
||||
|
||||
if (name) {
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'name' does not exist on type '{}'.
|
||||
|
||||
data.name = name;
|
||||
}
|
||||
|
||||
if (gitRepositoryUrl) {
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'gitRepositoryUrl' does not exist on type... Remove this comment to see the full error message
|
||||
|
||||
data.gitRepositoryUrl = gitRepositoryUrl;
|
||||
}
|
||||
|
||||
if (gitCredential) {
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'gitCredential' does not exist on type '{... Remove this comment to see the full error message
|
||||
|
||||
data.gitCredential = gitCredential;
|
||||
}
|
||||
let unsetData;
|
||||
@@ -127,7 +127,7 @@ router.put(
|
||||
}
|
||||
);
|
||||
if (resourceCategoryCount && resourceCategoryCount) {
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'resourceCategory' does not exist on type... Remove this comment to see the full error message
|
||||
|
||||
data.resourceCategory = resourceCategory;
|
||||
} else {
|
||||
unsetData = { resourceCategory: '' };
|
||||
@@ -137,7 +137,7 @@ router.put(
|
||||
const applicationSecurity = await ApplicationSecurityService.updateOneBy(
|
||||
{ _id: applicationSecurityId, componentId },
|
||||
data,
|
||||
// @ts-expect-error ts-migrate(2345) FIXME: Argument of type '{ resourceCategory: string; } | ... Remove this comment to see the full error message
|
||||
|
||||
unsetData
|
||||
);
|
||||
return sendItemResponse(req, res, applicationSecurity);
|
||||
@@ -392,7 +392,7 @@ router.post(
|
||||
const error = new Error(
|
||||
'Application Security not found or does not exist'
|
||||
);
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'code' does not exist on type 'Error'.
|
||||
|
||||
error.code = 400;
|
||||
return sendErrorResponse(req, res, error);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import express from 'express';
|
||||
const getUser = require('../middlewares/user').getUser;
|
||||
// @ts-expect-error ts-migrate(2614) FIXME: Module '"../middlewares/authorization"' has no exp... Remove this comment to see the full error message
|
||||
|
||||
import { isAuthorized } from '../middlewares/authorization';
|
||||
const sendErrorResponse = require('../middlewares/response').sendErrorResponse;
|
||||
const sendItemResponse = require('../middlewares/response').sendItemResponse;
|
||||
|
||||
@@ -7,7 +7,7 @@ const isUserMasterAdmin = require('../middlewares/user').isUserMasterAdmin;
|
||||
|
||||
const sendErrorResponse = require('../middlewares/response').sendErrorResponse;
|
||||
const sendListResponse = require('../middlewares/response').sendListResponse;
|
||||
// @ts-expect-error ts-migrate(2614) FIXME: Module '"../middlewares/response"' has no exported... Remove this comment to see the full error message
|
||||
|
||||
import { sendItemResponse } from '../middlewares/response';
|
||||
|
||||
router.get('/', getUser, isUserMasterAdmin, async function(req, res) {
|
||||
|
||||
@@ -4,11 +4,11 @@ const router = express.Router();
|
||||
import AutomatedScriptService from '../services/automatedScriptService';
|
||||
const sendErrorResponse = require('../middlewares/response').sendErrorResponse;
|
||||
const sendListResponse = require('../middlewares/response').sendListResponse;
|
||||
// @ts-expect-error ts-migrate(2614) FIXME: Module '"../middlewares/response"' has no exported... Remove this comment to see the full error message
|
||||
|
||||
import { sendItemResponse } from '../middlewares/response';
|
||||
// @ts-expect-error ts-migrate(2614) FIXME: Module '"../middlewares/authorization"' has no exp... Remove this comment to see the full error message
|
||||
|
||||
import { isAuthorized } from '../middlewares/authorization';
|
||||
// @ts-expect-error ts-migrate(2614) FIXME: Module '"../middlewares/user"' has no exported mem... Remove this comment to see the full error message
|
||||
|
||||
import { getUser } from '../middlewares/user';
|
||||
|
||||
router.get('/:projectId', getUser, isAuthorized, async function(req, res) {
|
||||
@@ -51,12 +51,12 @@ router.get(
|
||||
});
|
||||
|
||||
if (details.successEvent.length > 0) {
|
||||
// @ts-expect-error ts-migrate(2554) FIXME: Expected 2 arguments, but got 1.
|
||||
|
||||
details.successEvent = formatEvent(details.successEvent);
|
||||
}
|
||||
|
||||
if (details.failureEvent.length > 0) {
|
||||
// @ts-expect-error ts-migrate(2554) FIXME: Expected 2 arguments, but got 1.
|
||||
|
||||
details.failureEvent = formatEvent(details.failureEvent);
|
||||
}
|
||||
|
||||
@@ -221,7 +221,7 @@ router.put(
|
||||
async (req, res) => {
|
||||
try {
|
||||
const { automatedScriptId } = req.params;
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'user' does not exist on type 'Request<{ ... Remove this comment to see the full error message
|
||||
|
||||
const triggeredId = req.user ? req.user.id : null;
|
||||
const response = await AutomatedScriptService.runResource({
|
||||
triggeredId,
|
||||
@@ -253,7 +253,7 @@ router.delete(
|
||||
select,
|
||||
populate,
|
||||
});
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'user' does not exist on type 'Request<{ ... Remove this comment to see the full error message
|
||||
|
||||
const userId = req.user ? req.user.id : null;
|
||||
const response = await AutomatedScriptService.deleteBy(
|
||||
{
|
||||
|
||||
@@ -2,11 +2,11 @@ const sendErrorResponse = require('../middlewares/response').sendErrorResponse;
|
||||
const sendListResponse = require('../middlewares/response').sendListResponse;
|
||||
const sendItemResponse = require('../middlewares/response').sendItemResponse;
|
||||
|
||||
// @ts-expect-error ts-migrate(2614) FIXME: Module '"../middlewares/user"' has no exported mem... Remove this comment to see the full error message
|
||||
|
||||
import { getUser } from '../middlewares/user';
|
||||
// @ts-expect-error ts-migrate(2614) FIXME: Module '"../middlewares/project"' has no exported ... Remove this comment to see the full error message
|
||||
|
||||
import { getUserRole } from '../middlewares/project';
|
||||
// @ts-expect-error ts-migrate(2614) FIXME: Module '"../middlewares/authorization"' has no exp... Remove this comment to see the full error message
|
||||
|
||||
import { isAuthorized } from '../middlewares/authorization';
|
||||
|
||||
export default ({
|
||||
|
||||
@@ -7,7 +7,7 @@ const isUserMasterAdmin = require('../middlewares/user').isUserMasterAdmin;
|
||||
|
||||
const sendErrorResponse = require('../middlewares/response').sendErrorResponse;
|
||||
const sendListResponse = require('../middlewares/response').sendListResponse;
|
||||
// @ts-expect-error ts-migrate(2614) FIXME: Module '"../middlewares/response"' has no exported... Remove this comment to see the full error message
|
||||
|
||||
import { sendItemResponse } from '../middlewares/response';
|
||||
|
||||
router.get('/', getUser, isUserMasterAdmin, async function(req, res) {
|
||||
@@ -70,7 +70,7 @@ router.post('/', getUser, isUserMasterAdmin, async (req, res) => {
|
||||
message: 'Call Log Content is required',
|
||||
});
|
||||
}
|
||||
// @ts-expect-error ts-migrate(2554) FIXME: Expected 6 arguments, but got 1.
|
||||
|
||||
const callLog = await CallLogsService.create(data);
|
||||
return sendItemResponse(req, res, callLog);
|
||||
} catch (error) {
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import express from 'express';
|
||||
// @ts-expect-error ts-migrate(2614) FIXME: Module '"../services/twilioService"' has no export... Remove this comment to see the full error message
|
||||
|
||||
import { fetchPhoneNumbers } from '../services/twilioService';
|
||||
import CallRoutingService from '../services/callRoutingService';
|
||||
import FileService from '../services/fileService';
|
||||
// @ts-expect-error ts-migrate(2614) FIXME: Module '"../middlewares/authorization"' has no exp... Remove this comment to see the full error message
|
||||
|
||||
import { isAuthorized } from '../middlewares/authorization';
|
||||
const getUser = require('../middlewares/user').getUser;
|
||||
const isUserAdmin = require('../middlewares/project').isUserAdmin;
|
||||
@@ -95,9 +95,9 @@ router.get('/:projectId', getUser, isAuthorized, async (req, res) => {
|
||||
try {
|
||||
let { skip, limit } = req.query;
|
||||
const { projectId } = req.params;
|
||||
// @ts-expect-error ts-migrate(2322) FIXME: Type 'number' is not assignable to type 'string | ... Remove this comment to see the full error message
|
||||
|
||||
if (typeof skip === 'string') skip = parseInt(skip);
|
||||
// @ts-expect-error ts-migrate(2322) FIXME: Type 'number' is not assignable to type 'string | ... Remove this comment to see the full error message
|
||||
|
||||
if (typeof limit === 'string') limit = parseInt(limit);
|
||||
|
||||
const populate = [{ path: 'projectId', select: 'name slug _id' }];
|
||||
@@ -214,20 +214,20 @@ router.put(
|
||||
return sendErrorResponse(req, res, error);
|
||||
}
|
||||
const data = {};
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'audioFieldName' does not exist on type '... Remove this comment to see the full error message
|
||||
|
||||
data.audioFieldName = audioFieldName;
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'callRoutingId' does not exist on type '{... Remove this comment to see the full error message
|
||||
|
||||
data.callRoutingId = callRoutingId;
|
||||
if (
|
||||
req.files &&
|
||||
// @ts-expect-error ts-migrate(7053) FIXME: Element implicitly has an 'any' type because expre... Remove this comment to see the full error message
|
||||
|
||||
req.files[audioFieldName] &&
|
||||
// @ts-expect-error ts-migrate(7053) FIXME: Element implicitly has an 'any' type because expre... Remove this comment to see the full error message
|
||||
|
||||
req.files[audioFieldName][0].filename
|
||||
) {
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'file' does not exist on type '{}'.
|
||||
|
||||
data.file = req.files[audioFieldName][0].filename;
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'fileName' does not exist on type '{}'.
|
||||
|
||||
data.fileName = req.files[audioFieldName][0].originalname;
|
||||
}
|
||||
const CallRouting = await CallRoutingService.updateRoutingSchemaAudio(
|
||||
@@ -248,7 +248,7 @@ router.delete(
|
||||
async function(req, res) {
|
||||
try {
|
||||
const { projectId, callRoutingId } = req.params;
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'user' does not exist on type 'Request<{ ... Remove this comment to see the full error message
|
||||
|
||||
const userId = req.user.id;
|
||||
if (!callRoutingId) {
|
||||
return sendErrorResponse(req, res, {
|
||||
@@ -290,12 +290,12 @@ router.delete(
|
||||
routingSchema = routingSchema.routingSchema;
|
||||
const query = {};
|
||||
if (backup) {
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'filename' does not exist on type '{}'.
|
||||
|
||||
query.filename = routingSchema.backup_introAudio;
|
||||
routingSchema.backup_introAudio = null;
|
||||
routingSchema.backup_introAudioName = '';
|
||||
} else {
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'filename' does not exist on type '{}'.
|
||||
|
||||
query.filename = routingSchema.introAudio;
|
||||
routingSchema.introAudio = null;
|
||||
routingSchema.introAudioName = '';
|
||||
|
||||
@@ -82,7 +82,7 @@ router.delete('/store/:id', async (req, res) => {
|
||||
router.post('/certOrder', async (req, res) => {
|
||||
try {
|
||||
const domains = [];
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'greenlock' does not exist on type 'Globa... Remove this comment to see the full error message
|
||||
|
||||
const greenlock = global.greenlock;
|
||||
// to refresh the managers set clearManager to true
|
||||
const { domain, clearManagers } = req.body;
|
||||
@@ -123,7 +123,7 @@ router.post('/certOrder', async (req, res) => {
|
||||
select: 'domains',
|
||||
});
|
||||
|
||||
// @ts-expect-error ts-migrate(2488) FIXME: Type '{}' must have a '[Symbol.iterator]()' method... Remove this comment to see the full error message
|
||||
|
||||
for (const statusPage of statusPages) {
|
||||
for (const domain of statusPage.domains) {
|
||||
if (
|
||||
@@ -168,7 +168,7 @@ router.post('/certOrder', async (req, res) => {
|
||||
// id => domain/subdomain
|
||||
router.delete('/certDelete/:id', async (req, res) => {
|
||||
try {
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'greenlock' does not exist on type 'Globa... Remove this comment to see the full error message
|
||||
|
||||
const greenlock = global.greenlock;
|
||||
const { id } = req.body;
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ const isUserAdmin = require('../middlewares/project').isUserAdmin;
|
||||
const getUser = require('../middlewares/user').getUser;
|
||||
const getSubProjects = require('../middlewares/subProject').getSubProjects;
|
||||
|
||||
// @ts-expect-error ts-migrate(2614) FIXME: Module '"../middlewares/authorization"' has no exp... Remove this comment to see the full error message
|
||||
|
||||
import { isAuthorized } from '../middlewares/authorization';
|
||||
const sendErrorResponse = require('../middlewares/response').sendErrorResponse;
|
||||
const sendItemResponse = require('../middlewares/response').sendItemResponse;
|
||||
@@ -46,7 +46,7 @@ router.post('/:projectId', getUser, isAuthorized, isUserAdmin, async function(
|
||||
message: "values can't be null",
|
||||
});
|
||||
}
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'user' does not exist on type 'Request<{ ... Remove this comment to see the full error message
|
||||
|
||||
data.createdById = req.user ? req.user.id : null;
|
||||
|
||||
if (!data.name) {
|
||||
@@ -68,14 +68,14 @@ router.post('/:projectId', getUser, isAuthorized, isUserAdmin, async function(
|
||||
const component = await ComponentService.create(data);
|
||||
|
||||
const user = await UserService.findOneBy({
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'user' does not exist on type 'Request<{ ... Remove this comment to see the full error message
|
||||
|
||||
query: { _id: req.user.id },
|
||||
select: 'name _id',
|
||||
});
|
||||
|
||||
if (component) {
|
||||
try {
|
||||
// @ts-expect-error ts-migrate(2554) FIXME: Expected 5 arguments, but got 4.
|
||||
|
||||
NotificationService.create(
|
||||
component.projectId._id || component.projectId,
|
||||
`A New Component was Created with name ${component.name} by ${user.name}`,
|
||||
@@ -205,9 +205,9 @@ router.get(
|
||||
async function(req, res) {
|
||||
try {
|
||||
const type = req.query.type;
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'user' does not exist on type 'Request<{ ... Remove this comment to see the full error message
|
||||
|
||||
const subProjectIds = req.user.subProjects
|
||||
? // @ts-expect-error ts-migrate(2339) FIXME: Property 'user' does not exist on type 'Request<{ ... Remove this comment to see the full error message
|
||||
?
|
||||
req.user.subProjects.map((project: $TSFixMe) => project._id)
|
||||
: null;
|
||||
const query = type
|
||||
@@ -250,9 +250,9 @@ router.get(
|
||||
try {
|
||||
const componentId = req.params.componentId;
|
||||
const type = req.query.type;
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'user' does not exist on type 'Request<{ ... Remove this comment to see the full error message
|
||||
|
||||
const subProjectIds = req.user.subProjects
|
||||
? // @ts-expect-error ts-migrate(2339) FIXME: Property 'user' does not exist on type 'Request<{ ... Remove this comment to see the full error message
|
||||
?
|
||||
req.user.subProjects.map((project: $TSFixMe) => project._id)
|
||||
: null;
|
||||
const query = type
|
||||
@@ -288,9 +288,9 @@ router.post(
|
||||
try {
|
||||
const { startDate, endDate } = req.body;
|
||||
const componentId = req.params.componentId;
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'user' does not exist on type 'Request<{ ... Remove this comment to see the full error message
|
||||
|
||||
const subProjectIds = req.user.subProjects
|
||||
? // @ts-expect-error ts-migrate(2339) FIXME: Property 'user' does not exist on type 'Request<{ ... Remove this comment to see the full error message
|
||||
?
|
||||
req.user.subProjects.map((project: $TSFixMe) => project._id)
|
||||
: null;
|
||||
|
||||
@@ -349,9 +349,9 @@ router.post(
|
||||
const monitorUptime =
|
||||
uptimePercents.reduce(
|
||||
(a, b) =>
|
||||
// @ts-expect-error ts-migrate(2345) FIXME: Argument of type 'number' is not assignable to par... Remove this comment to see the full error message
|
||||
|
||||
parseFloat(a || 100) +
|
||||
// @ts-expect-error ts-migrate(2345) FIXME: Argument of type 'number' is not assignable to par... Remove this comment to see the full error message
|
||||
|
||||
parseFloat(b || 100)
|
||||
) / uptimePercents.length;
|
||||
|
||||
@@ -391,9 +391,9 @@ router.get(
|
||||
try {
|
||||
const componentId = req.params.componentId;
|
||||
const type = req.query.type;
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'user' does not exist on type 'Request<{ ... Remove this comment to see the full error message
|
||||
|
||||
const subProjectIds = req.user.subProjects
|
||||
? // @ts-expect-error ts-migrate(2339) FIXME: Property 'user' does not exist on type 'Request<{ ... Remove this comment to see the full error message
|
||||
?
|
||||
req.user.subProjects.map((project: $TSFixMe) => project._id)
|
||||
: null;
|
||||
|
||||
@@ -704,9 +704,9 @@ router.get(
|
||||
getSubProjects,
|
||||
async function(req, res) {
|
||||
try {
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'user' does not exist on type 'Request<{ ... Remove this comment to see the full error message
|
||||
|
||||
const subProjectIds = req.user.subProjects
|
||||
? // @ts-expect-error ts-migrate(2339) FIXME: Property 'user' does not exist on type 'Request<{ ... Remove this comment to see the full error message
|
||||
?
|
||||
req.user.subProjects.map((project: $TSFixMe) => project._id)
|
||||
: null;
|
||||
|
||||
@@ -719,7 +719,7 @@ router.get(
|
||||
let allComponents: $TSFixMe = [];
|
||||
|
||||
components.map(component => {
|
||||
// @ts-expect-error ts-migrate(2571) FIXME: Object is of type 'unknown'.
|
||||
|
||||
allComponents = [...allComponents, ...component.components];
|
||||
return component;
|
||||
});
|
||||
@@ -736,7 +736,7 @@ router.get(
|
||||
{ path: 'resourceCategory', select: 'name' },
|
||||
];
|
||||
await Promise.all(
|
||||
// @ts-expect-error ts-migrate(7006) FIXME: Parameter 'component' implicitly has an 'any' type... Remove this comment to see the full error message
|
||||
|
||||
allComponents.map(async component => {
|
||||
const componentErrorTrackers = await ErrorTrackerService.findBy(
|
||||
{
|
||||
@@ -778,7 +778,7 @@ router.delete(
|
||||
componentId: componentId,
|
||||
projectId: projectId,
|
||||
},
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'user' does not exist on type 'Request<{ ... Remove this comment to see the full error message
|
||||
|
||||
req.user.id
|
||||
);
|
||||
const component = await ComponentService.deleteBy(
|
||||
@@ -786,7 +786,7 @@ router.delete(
|
||||
_id: componentId,
|
||||
projectId: projectId,
|
||||
},
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'user' does not exist on type 'Request<{ ... Remove this comment to see the full error message
|
||||
|
||||
req.user.id
|
||||
);
|
||||
if (component) {
|
||||
|
||||
@@ -78,14 +78,14 @@ router.post('/log', isAuthorizedContainerScanner, async function(req, res) {
|
||||
{ path: 'componentId', select: 'name slug projectId' },
|
||||
];
|
||||
const findLog = await ContainerSecurityLogService.findOneBy({
|
||||
// @ts-expect-error ts-migrate(2571) FIXME: Object is of type 'unknown'.
|
||||
|
||||
query: { _id: securityLog._id },
|
||||
select: selectContainerLog,
|
||||
populate: populateContainerLog,
|
||||
});
|
||||
// @ts-expect-error ts-migrate(2345) FIXME: Argument of type '{ query: { _id: any; }; select: ... Remove this comment to see the full error message
|
||||
|
||||
const project = await ProjectService.findOneBy({
|
||||
// @ts-expect-error ts-migrate(2571) FIXME: Object is of type 'unknown'.
|
||||
|
||||
query: { _id: findLog.componentId.projectId },
|
||||
select: '_id name users',
|
||||
});
|
||||
@@ -94,27 +94,27 @@ router.post('/log', isAuthorizedContainerScanner, async function(req, res) {
|
||||
.map((e: $TSFixMe) => ({
|
||||
id: e.userId,
|
||||
})); // This cater for projects with multiple registered members
|
||||
// @ts-expect-error ts-migrate(2571) FIXME: Object is of type 'unknown'.
|
||||
|
||||
project.critical = findLog.data.vulnerabilityInfo.critical;
|
||||
// @ts-expect-error ts-migrate(2571) FIXME: Object is of type 'unknown'.
|
||||
|
||||
project.high = findLog.data.vulnerabilityInfo.high;
|
||||
// @ts-expect-error ts-migrate(2571) FIXME: Object is of type 'unknown'.
|
||||
|
||||
project.moderate = findLog.data.vulnerabilityInfo.moderate;
|
||||
// @ts-expect-error ts-migrate(2571) FIXME: Object is of type 'unknown'.
|
||||
|
||||
project.low = findLog.data.vulnerabilityInfo.low;
|
||||
// @ts-expect-error ts-migrate(2571) FIXME: Object is of type 'unknown'.
|
||||
|
||||
const critical = findLog.data.vulnerabilityData
|
||||
.filter((e: $TSFixMe) => e.severity === 'critical')
|
||||
.slice(0, 10);
|
||||
// @ts-expect-error ts-migrate(2571) FIXME: Object is of type 'unknown'.
|
||||
|
||||
const high = findLog.data.vulnerabilityData
|
||||
.filter((e: $TSFixMe) => e.severity === 'high')
|
||||
.slice(0, 10);
|
||||
// @ts-expect-error ts-migrate(2571) FIXME: Object is of type 'unknown'.
|
||||
|
||||
const moderate = findLog.data.vulnerabilityData
|
||||
.filter((e: $TSFixMe) => e.severity === 'moderate')
|
||||
.slice(0, 5);
|
||||
// @ts-expect-error ts-migrate(2571) FIXME: Object is of type 'unknown'.
|
||||
|
||||
const low = findLog.data.vulnerabilityData
|
||||
.filter((e: $TSFixMe) => e.severity === 'low')
|
||||
.slice(0, 5);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import express from 'express';
|
||||
const getUser = require('../middlewares/user').getUser;
|
||||
// @ts-expect-error ts-migrate(2614) FIXME: Module '"../middlewares/authorization"' has no exp... Remove this comment to see the full error message
|
||||
|
||||
import { isAuthorized } from '../middlewares/authorization';
|
||||
const sendErrorResponse = require('../middlewares/response').sendErrorResponse;
|
||||
const sendItemResponse = require('../middlewares/response').sendItemResponse;
|
||||
@@ -104,22 +104,22 @@ router.put(
|
||||
const data = {};
|
||||
|
||||
if (name) {
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'name' does not exist on type '{}'.
|
||||
|
||||
data.name = name;
|
||||
}
|
||||
|
||||
if (dockerCredential) {
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'dockerCredential' does not exist on type... Remove this comment to see the full error message
|
||||
|
||||
data.dockerCredential = dockerCredential;
|
||||
}
|
||||
|
||||
if (imagePath) {
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'imagePath' does not exist on type '{}'.
|
||||
|
||||
data.imagePath = imagePath;
|
||||
}
|
||||
|
||||
if (imageTags) {
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'imageTags' does not exist on type '{}'.
|
||||
|
||||
data.imageTags = imageTags;
|
||||
}
|
||||
let unsetData;
|
||||
@@ -132,7 +132,7 @@ router.put(
|
||||
}
|
||||
);
|
||||
if (resourceCategoryCount && resourceCategoryCount > 0) {
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'resourceCategory' does not exist on type... Remove this comment to see the full error message
|
||||
|
||||
data.resourceCategory = resourceCategory;
|
||||
} else {
|
||||
unsetData = { resourceCategory: '' };
|
||||
@@ -142,7 +142,7 @@ router.put(
|
||||
const containerSecurity = await ContainerSecurityService.updateOneBy(
|
||||
{ _id: containerSecurityId, componentId },
|
||||
data,
|
||||
// @ts-expect-error ts-migrate(2345) FIXME: Argument of type '{ resourceCategory: string; } | ... Remove this comment to see the full error message
|
||||
|
||||
unsetData
|
||||
);
|
||||
return sendItemResponse(req, res, containerSecurity);
|
||||
@@ -377,7 +377,7 @@ router.post(
|
||||
const error = new Error(
|
||||
'Container Security not found or does not exist'
|
||||
);
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'code' does not exist on type 'Error'.
|
||||
|
||||
error.code = 400;
|
||||
return sendErrorResponse(req, res, error);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import express from 'express';
|
||||
const getUser = require('../middlewares/user').getUser;
|
||||
// @ts-expect-error ts-migrate(2614) FIXME: Module '"../middlewares/authorization"' has no exp... Remove this comment to see the full error message
|
||||
|
||||
import { isAuthorized } from '../middlewares/authorization';
|
||||
const sendErrorResponse = require('../middlewares/response').sendErrorResponse;
|
||||
const sendItemResponse = require('../middlewares/response').sendItemResponse;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import express from 'express';
|
||||
// @ts-expect-error ts-migrate(2614) FIXME: Module '"../middlewares/authorization"' has no exp... Remove this comment to see the full error message
|
||||
|
||||
import { isAuthorized } from '../middlewares/authorization';
|
||||
// @ts-expect-error ts-migrate(2614) FIXME: Module '"../middlewares/user"' has no exported mem... Remove this comment to see the full error message
|
||||
|
||||
import { getUser } from '../middlewares/user';
|
||||
const {
|
||||
sendErrorResponse,
|
||||
@@ -19,14 +19,14 @@ router.post('/:projectId', getUser, isAuthorized, async function(req, res) {
|
||||
|
||||
if (!fieldName || !fieldName.trim()) {
|
||||
const error = new Error('Field name is required');
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'code' does not exist on type 'Error'.
|
||||
|
||||
error.code = 400;
|
||||
throw error;
|
||||
}
|
||||
|
||||
if (!fieldType || !fieldType.trim()) {
|
||||
const error = new Error('Field type is required');
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'code' does not exist on type 'Error'.
|
||||
|
||||
error.code = 400;
|
||||
throw error;
|
||||
}
|
||||
@@ -42,7 +42,7 @@ router.post('/:projectId', getUser, isAuthorized, async function(req, res) {
|
||||
const error = new Error(
|
||||
'Custom field with this name already exist'
|
||||
);
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'code' does not exist on type 'Error'.
|
||||
|
||||
error.code = 400;
|
||||
throw error;
|
||||
}
|
||||
@@ -96,14 +96,14 @@ router.put('/:projectId/:customFieldId', getUser, isAuthorized, async function(
|
||||
|
||||
if (!fieldName || !fieldName.trim()) {
|
||||
const error = new Error('Field name is required');
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'code' does not exist on type 'Error'.
|
||||
|
||||
error.code = 400;
|
||||
throw error;
|
||||
}
|
||||
|
||||
if (!fieldType || !fieldType.trim()) {
|
||||
const error = new Error('Field type is required');
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'code' does not exist on type 'Error'.
|
||||
|
||||
error.code = 400;
|
||||
throw error;
|
||||
}
|
||||
@@ -119,7 +119,7 @@ router.put('/:projectId/:customFieldId', getUser, isAuthorized, async function(
|
||||
const error = new Error(
|
||||
'Custom field with this name already exist'
|
||||
);
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'code' does not exist on type 'Error'.
|
||||
|
||||
error.code = 400;
|
||||
throw error;
|
||||
}
|
||||
|
||||
@@ -24,21 +24,21 @@ router.put('/default', async (req, res) => {
|
||||
}
|
||||
|
||||
const data = {};
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'store' does not exist on type '{}'.
|
||||
|
||||
if (store) data.store = store;
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'challenges' does not exist on type '{}'.
|
||||
|
||||
if (challenges) data.challenges = challenges;
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'renewOffset' does not exist on type '{}'... Remove this comment to see the full error message
|
||||
|
||||
if (renewOffset) data.renewOffset = renewOffset;
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'renewStagger' does not exist on type '{}... Remove this comment to see the full error message
|
||||
|
||||
if (renewStagger) data.renewStagger = renewStagger;
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'accountKeyType' does not exist on type '... Remove this comment to see the full error message
|
||||
|
||||
if (accountKeyType) data.accountKeyType = accountKeyType;
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'serverKeyType' does not exist on type '{... Remove this comment to see the full error message
|
||||
|
||||
if (serverKeyType) data.serverKeyType = serverKeyType;
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'subscriberEmail' does not exist on type ... Remove this comment to see the full error message
|
||||
|
||||
if (subscriberEmail) data.subscriberEmail = subscriberEmail;
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'agreeToTerms' does not exist on type '{}... Remove this comment to see the full error message
|
||||
|
||||
if (agreeToTerms) data.agreeToTerms = agreeToTerms;
|
||||
|
||||
// if there's no default value
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import express from 'express';
|
||||
const getUser = require('../middlewares/user').getUser;
|
||||
// @ts-expect-error ts-migrate(2614) FIXME: Module '"../middlewares/authorization"' has no exp... Remove this comment to see the full error message
|
||||
|
||||
import { isAuthorized } from '../middlewares/authorization';
|
||||
const sendErrorResponse = require('../middlewares/response').sendErrorResponse;
|
||||
const sendItemResponse = require('../middlewares/response').sendItemResponse;
|
||||
@@ -98,15 +98,15 @@ router.put(
|
||||
|
||||
const data = {};
|
||||
if (dockerRegistryUrl) {
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'dockerRegistryUrl' does not exist on typ... Remove this comment to see the full error message
|
||||
|
||||
data.dockerRegistryUrl = dockerRegistryUrl;
|
||||
}
|
||||
if (dockerUsername) {
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'dockerUsername' does not exist on type '... Remove this comment to see the full error message
|
||||
|
||||
data.dockerUsername = dockerUsername;
|
||||
}
|
||||
if (dockerPassword) {
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'dockerPassword' does not exist on type '... Remove this comment to see the full error message
|
||||
|
||||
data.dockerPassword = dockerPassword;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
import express from 'express';
|
||||
// @ts-expect-error ts-migrate(7016) FIXME: Could not find a declaration file for module 'psl'... Remove this comment to see the full error message
|
||||
|
||||
import psl from 'psl';
|
||||
// @ts-expect-error ts-migrate(2614) FIXME: Module '"../middlewares/user"' has no exported mem... Remove this comment to see the full error message
|
||||
|
||||
import { getUser, isUserMasterAdmin } from '../middlewares/user';
|
||||
// @ts-expect-error ts-migrate(2614) FIXME: Module '"../middlewares/authorization"' has no exp... Remove this comment to see the full error message
|
||||
|
||||
import { isAuthorized } from '../middlewares/authorization';
|
||||
const sendErrorResponse = require('../middlewares/response').sendErrorResponse;
|
||||
const sendItemResponse = require('../middlewares/response').sendItemResponse;
|
||||
import DomainVerificationService from '../services/domainVerificationService';
|
||||
// @ts-expect-error ts-migrate(2614) FIXME: Module '"../middlewares/response"' has no exported... Remove this comment to see the full error message
|
||||
|
||||
import { sendListResponse } from '../middlewares/response';
|
||||
import StatusPageService from '../services/statusPageService';
|
||||
import ProjectService from '../services/projectService';
|
||||
@@ -52,7 +52,7 @@ router.put(
|
||||
const response = await DomainVerificationService.updateOneBy(
|
||||
{ _id: domainId },
|
||||
{ verified: true, verifiedAt: Date.now() },
|
||||
// @ts-expect-error ts-migrate(2554) FIXME: Expected 2 arguments, but got 3.
|
||||
|
||||
subDomain
|
||||
);
|
||||
return sendItemResponse(req, res, response);
|
||||
@@ -135,7 +135,7 @@ router.post('/:projectId/domain', getUser, isAuthorized, async (req, res) => {
|
||||
|
||||
if (!domain || !domain.trim()) {
|
||||
const error = new Error('Please specify a domain');
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'code' does not exist on type 'Error'.
|
||||
|
||||
error.code = 400;
|
||||
throw error;
|
||||
}
|
||||
@@ -148,7 +148,7 @@ router.post('/:projectId/domain', getUser, isAuthorized, async (req, res) => {
|
||||
const error = new Error(
|
||||
'Please specify only domains and not sub-domains'
|
||||
);
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'code' does not exist on type 'Error'.
|
||||
|
||||
error.code = 400;
|
||||
throw error;
|
||||
}
|
||||
@@ -160,7 +160,7 @@ router.post('/:projectId/domain', getUser, isAuthorized, async (req, res) => {
|
||||
);
|
||||
if (doesDomainBelongToProject) {
|
||||
const error = new Error('Domain already belong to another project');
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'code' does not exist on type 'Error'.
|
||||
|
||||
error.code = 400;
|
||||
throw error;
|
||||
}
|
||||
@@ -207,7 +207,7 @@ router.put(
|
||||
|
||||
if (!domain || !domain.trim()) {
|
||||
const error = new Error('Please specify a domain');
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'code' does not exist on type 'Error'.
|
||||
|
||||
error.code = 400;
|
||||
throw error;
|
||||
}
|
||||
@@ -220,7 +220,7 @@ router.put(
|
||||
const error = new Error(
|
||||
'Please specify only domains and not sub-domains'
|
||||
);
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'code' does not exist on type 'Error'.
|
||||
|
||||
error.code = 400;
|
||||
throw error;
|
||||
}
|
||||
@@ -234,7 +234,7 @@ router.put(
|
||||
const error = new Error(
|
||||
'Domain already belong to another project'
|
||||
);
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'code' does not exist on type 'Error'.
|
||||
|
||||
error.code = 400;
|
||||
throw error;
|
||||
}
|
||||
@@ -278,7 +278,7 @@ router.delete(
|
||||
const projectArr = await ProjectService.findSubprojectId(projectId);
|
||||
const projectIdInArr = await DomainVerificationService.findDomain(
|
||||
domainId,
|
||||
// @ts-expect-error ts-migrate(2345) FIXME: Argument of type 'any[]' is not assignable to para... Remove this comment to see the full error message
|
||||
|
||||
projectArr
|
||||
);
|
||||
const response = await DomainVerificationService.deleteBy({
|
||||
|
||||
@@ -7,7 +7,7 @@ const isUserMasterAdmin = require('../middlewares/user').isUserMasterAdmin;
|
||||
|
||||
const sendErrorResponse = require('../middlewares/response').sendErrorResponse;
|
||||
const sendListResponse = require('../middlewares/response').sendListResponse;
|
||||
// @ts-expect-error ts-migrate(2614) FIXME: Module '"../middlewares/response"' has no exported... Remove this comment to see the full error message
|
||||
|
||||
import { sendItemResponse } from '../middlewares/response';
|
||||
|
||||
router.get('/', getUser, isUserMasterAdmin, async function(req, res) {
|
||||
|
||||
@@ -2,7 +2,7 @@ import express from 'express';
|
||||
import EmailSmtpService from '../services/emailSmtpService';
|
||||
import MailService from '../services/mailService';
|
||||
const router = express.Router();
|
||||
// @ts-expect-error ts-migrate(2614) FIXME: Module '"../middlewares/authorization"' has no exp... Remove this comment to see the full error message
|
||||
|
||||
import { isAuthorized } from '../middlewares/authorization';
|
||||
const getUser = require('../middlewares/user').getUser;
|
||||
const isUserMasterAdmin = require('../middlewares/user').isUserMasterAdmin;
|
||||
@@ -85,7 +85,7 @@ router.post('/:projectId', getUser, isAuthorized, async function(req, res) {
|
||||
const data = req.body;
|
||||
data.projectId = req.params.projectId;
|
||||
const user = await UserService.findOneBy({
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'user' does not exist on type 'Request<{ ... Remove this comment to see the full error message
|
||||
|
||||
query: { _id: req.user.id },
|
||||
select: 'email',
|
||||
});
|
||||
@@ -167,7 +167,7 @@ router.put('/:projectId/:emailSmtpId', getUser, isAuthorized, async function(
|
||||
const data = req.body;
|
||||
const emailSmtpId = req.params.emailSmtpId;
|
||||
const user = await UserService.findOneBy({
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'user' does not exist on type 'Request<{ ... Remove this comment to see the full error message
|
||||
|
||||
query: { _id: req.user.id },
|
||||
select: 'email',
|
||||
});
|
||||
|
||||
@@ -3,13 +3,13 @@ import EmailTemplateService from '../services/emailTemplateService';
|
||||
|
||||
const router = express.Router();
|
||||
|
||||
// @ts-expect-error ts-migrate(7016) FIXME: Could not find a declaration file for module 'domp... Remove this comment to see the full error message
|
||||
|
||||
import createDOMPurify from 'dompurify';
|
||||
const jsdom = require('jsdom').jsdom;
|
||||
const window = jsdom('').defaultView;
|
||||
const DOMPurify = createDOMPurify(window);
|
||||
|
||||
// @ts-expect-error ts-migrate(2614) FIXME: Module '"../middlewares/authorization"' has no exp... Remove this comment to see the full error message
|
||||
|
||||
import { isAuthorized } from '../middlewares/authorization';
|
||||
const getUser = require('../middlewares/user').getUser;
|
||||
const isUserOwner = require('../middlewares/project').isUserOwner;
|
||||
@@ -185,7 +185,7 @@ router.delete(
|
||||
async function(req, res) {
|
||||
try {
|
||||
const emailTemplateId = req.params.emailTemplateId;
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'user' does not exist on type 'Request<{ ... Remove this comment to see the full error message
|
||||
|
||||
const userId = req.user.id;
|
||||
const emailTemplate = await EmailTemplateService.deleteBy(
|
||||
{ _id: emailTemplateId },
|
||||
|
||||
@@ -2,7 +2,7 @@ import express from 'express';
|
||||
|
||||
const router = express.Router();
|
||||
const getUser = require('../middlewares/user').getUser;
|
||||
// @ts-expect-error ts-migrate(2614) FIXME: Module '"../middlewares/authorization"' has no exp... Remove this comment to see the full error message
|
||||
|
||||
import { isAuthorized } from '../middlewares/authorization';
|
||||
const isUserAdmin = require('../middlewares/project').isUserAdmin;
|
||||
|
||||
@@ -15,7 +15,7 @@ import NotificationService from '../services/notificationService';
|
||||
import RealTimeService from '../services/realTimeService';
|
||||
import ErrorTrackerService from '../services/errorTrackerService';
|
||||
import ResourceCategoryService from '../services/resourceCategoryService';
|
||||
// @ts-expect-error ts-migrate(7016) FIXME: Could not find a declaration file for module 'uuid... Remove this comment to see the full error message
|
||||
|
||||
import uuid from 'uuid';
|
||||
const isErrorTrackerValid = require('../middlewares/errorTracker')
|
||||
.isErrorTrackerValid;
|
||||
@@ -46,7 +46,7 @@ router.post(
|
||||
message: "values can't be null",
|
||||
});
|
||||
}
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'user' does not exist on type 'Request<{ ... Remove this comment to see the full error message
|
||||
|
||||
data.createdById = req.user ? req.user.id : null;
|
||||
if (!data.name) {
|
||||
return sendErrorResponse(req, res, {
|
||||
@@ -76,17 +76,17 @@ router.post(
|
||||
populate: populateComponent,
|
||||
}),
|
||||
UserService.findOneBy({
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'user' does not exist on type 'Request<{ ... Remove this comment to see the full error message
|
||||
|
||||
query: { _id: req.user.id },
|
||||
select: 'name _id',
|
||||
}),
|
||||
]);
|
||||
|
||||
try {
|
||||
// @ts-expect-error ts-migrate(2554) FIXME: Expected 5 arguments, but got 4.
|
||||
|
||||
NotificationService.create(
|
||||
component.projectId._id,
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'name' does not exist on type 'Document<a... Remove this comment to see the full error message
|
||||
|
||||
`A New Error Tracker was Created with name ${errorTracker.name} by ${user.name}`,
|
||||
user._id,
|
||||
'errortrackeraddremove'
|
||||
@@ -146,7 +146,7 @@ router.delete(
|
||||
_id: errorTrackerId,
|
||||
componentId: componentId,
|
||||
},
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'user' does not exist on type 'Request<{ ... Remove this comment to see the full error message
|
||||
|
||||
req.user.id
|
||||
);
|
||||
if (errorTracker) {
|
||||
@@ -223,7 +223,7 @@ router.put(
|
||||
message: "values can't be null",
|
||||
});
|
||||
}
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'user' does not exist on type 'Request<{ ... Remove this comment to see the full error message
|
||||
|
||||
data.createdById = req.user ? req.user.id : null;
|
||||
if (!data.name && data.showQuickStart === undefined) {
|
||||
return sendErrorResponse(req, res, {
|
||||
@@ -255,7 +255,7 @@ router.put(
|
||||
componentId: componentId,
|
||||
};
|
||||
if (data.resourceCategory != '') {
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'resourceCategory' does not exist on type... Remove this comment to see the full error message
|
||||
|
||||
existingQuery.resourceCategory = data.resourceCategory;
|
||||
}
|
||||
const existingErrorTracking = await ErrorTrackerService.findBy({
|
||||
@@ -286,11 +286,11 @@ router.put(
|
||||
// Error Tracker is valid
|
||||
const errorTrackerUpdate = {};
|
||||
if (data.name) {
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'name' does not exist on type '{}'.
|
||||
|
||||
errorTrackerUpdate.name = data.name;
|
||||
}
|
||||
if (data.showQuickStart !== undefined) {
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'showQuickStart' does not exist on type '... Remove this comment to see the full error message
|
||||
|
||||
errorTrackerUpdate.showQuickStart = data.showQuickStart;
|
||||
}
|
||||
|
||||
@@ -304,7 +304,7 @@ router.put(
|
||||
}
|
||||
);
|
||||
if (resourceCategoryCount && resourceCategoryCount > 0) {
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'resourceCategory' does not exist on type... Remove this comment to see the full error message
|
||||
|
||||
errorTrackerUpdate.resourceCategory = data.resourceCategory;
|
||||
} else {
|
||||
unsetData = { resourceCategory: '' };
|
||||
@@ -315,7 +315,7 @@ router.put(
|
||||
const errorTracker = await ErrorTrackerService.updateOneBy(
|
||||
{ _id: currentErrorTracker._id },
|
||||
errorTrackerUpdate,
|
||||
// @ts-expect-error ts-migrate(2345) FIXME: Argument of type '{ resourceCategory: string; } | ... Remove this comment to see the full error message
|
||||
|
||||
unsetData
|
||||
);
|
||||
return sendItemResponse(req, res, errorTracker);
|
||||
@@ -417,16 +417,16 @@ router.post(
|
||||
|
||||
const query = {};
|
||||
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'errorTrackerId' does not exist on type '... Remove this comment to see the full error message
|
||||
|
||||
if (errorTrackerId) query.errorTrackerId = errorTrackerId;
|
||||
|
||||
if (startDate && endDate)
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'createdAt' does not exist on type '{}'.
|
||||
|
||||
query.createdAt = { $gte: startDate, $lte: endDate };
|
||||
|
||||
if (filters) {
|
||||
for (const [key, value] of Object.entries(filters)) {
|
||||
// @ts-expect-error ts-migrate(7053) FIXME: Element implicitly has an 'any' type because expre... Remove this comment to see the full error message
|
||||
|
||||
query[key] = value;
|
||||
}
|
||||
}
|
||||
@@ -624,7 +624,7 @@ router.post(
|
||||
updateData = {
|
||||
ignored: true,
|
||||
ignoredAt: new Date(),
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'user' does not exist on type 'Request<{ ... Remove this comment to see the full error message
|
||||
|
||||
ignoredById: req.user.id,
|
||||
resolved: false,
|
||||
resolvedAt: '',
|
||||
@@ -658,7 +658,7 @@ router.post(
|
||||
ignoredById: null,
|
||||
resolved: true,
|
||||
resolvedAt: new Date(),
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'user' does not exist on type 'Request<{ ... Remove this comment to see the full error message
|
||||
|
||||
resolvedById: req.user.id,
|
||||
};
|
||||
break;
|
||||
@@ -680,7 +680,7 @@ router.post(
|
||||
// add action to timeline for this particular issue
|
||||
const timelineData = {
|
||||
issueId: currentIssueId,
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'user' does not exist on type 'Request<{ ... Remove this comment to see the full error message
|
||||
|
||||
createdById: req.user ? req.user.id : null,
|
||||
status: action,
|
||||
};
|
||||
@@ -768,14 +768,14 @@ router.post(
|
||||
|
||||
const query = {};
|
||||
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'fingerprintHash' does not exist on type ... Remove this comment to see the full error message
|
||||
|
||||
query.fingerprintHash = fingerprintHash;
|
||||
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'errorTrackerId' does not exist on type '... Remove this comment to see the full error message
|
||||
|
||||
if (errorTrackerId) query.errorTrackerId = errorTrackerId;
|
||||
|
||||
if (startDate && endDate)
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'createdAt' does not exist on type '{}'.
|
||||
|
||||
query.createdAt = { $gte: startDate, $lte: endDate };
|
||||
|
||||
const errorEvents = await ErrorEventService.findBy({
|
||||
@@ -968,7 +968,7 @@ router.post(
|
||||
const data = {
|
||||
issueId,
|
||||
userId: teamMemberUserId,
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'user' does not exist on type 'Request<{ ... Remove this comment to see the full error message
|
||||
|
||||
createdById: req.user ? req.user.id : null,
|
||||
};
|
||||
// find if the issue member exist in the project
|
||||
@@ -1116,7 +1116,7 @@ router.post(
|
||||
const data = {
|
||||
removed: true,
|
||||
removedAt: new Date(),
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'user' does not exist on type 'Request<{ ... Remove this comment to see the full error message
|
||||
|
||||
removedById: req.user ? req.user.id : null,
|
||||
};
|
||||
// find the issueMember by the 3 parameters, and update it
|
||||
@@ -1203,7 +1203,7 @@ router.delete(
|
||||
_id: issueId,
|
||||
errorTrackerId,
|
||||
},
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'user' does not exist on type 'Request<{ ... Remove this comment to see the full error message
|
||||
|
||||
req.user.id,
|
||||
componentId
|
||||
);
|
||||
|
||||
@@ -6,7 +6,7 @@ const sendErrorResponse = require('../middlewares/response').sendErrorResponse;
|
||||
const sendItemResponse = require('../middlewares/response').sendItemResponse;
|
||||
|
||||
const getUser = require('../middlewares/user').getUser;
|
||||
// @ts-expect-error ts-migrate(2614) FIXME: Module '"../middlewares/authorization"' has no exp... Remove this comment to see the full error message
|
||||
|
||||
import { isAuthorized } from '../middlewares/authorization';
|
||||
|
||||
router.post('/:projectId', getUser, isAuthorized, async function(req, res) {
|
||||
@@ -22,7 +22,7 @@ router.post('/:projectId', getUser, isAuthorized, async function(req, res) {
|
||||
req.params.projectId,
|
||||
req.body.feedback,
|
||||
req.body.page,
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'user' does not exist on type 'Request<{ ... Remove this comment to see the full error message
|
||||
|
||||
req.user.id
|
||||
);
|
||||
return sendItemResponse(req, res, feedback);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import express from 'express';
|
||||
const getUser = require('../middlewares/user').getUser;
|
||||
// @ts-expect-error ts-migrate(2614) FIXME: Module '"../middlewares/authorization"' has no exp... Remove this comment to see the full error message
|
||||
|
||||
import { isAuthorized } from '../middlewares/authorization';
|
||||
const sendErrorResponse = require('../middlewares/response').sendErrorResponse;
|
||||
const sendItemResponse = require('../middlewares/response').sendItemResponse;
|
||||
@@ -91,21 +91,21 @@ router.put(
|
||||
const data = {};
|
||||
|
||||
if (gitUsername) {
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'gitUsername' does not exist on type '{}'... Remove this comment to see the full error message
|
||||
|
||||
data.gitUsername = gitUsername;
|
||||
}
|
||||
if (gitPassword) {
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'gitPassword' does not exist on type '{}'... Remove this comment to see the full error message
|
||||
|
||||
data.gitPassword = gitPassword;
|
||||
}
|
||||
|
||||
if (sshTitle) {
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'sshTitle' does not exist on type '{}'.
|
||||
|
||||
data.sshTitle = sshTitle;
|
||||
}
|
||||
|
||||
if (sshPrivateKey) {
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'sshPrivateKey' does not exist on type '{... Remove this comment to see the full error message
|
||||
|
||||
data.sshPrivateKey = sshPrivateKey;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import express from 'express';
|
||||
const getUser = require('../middlewares/user').getUser;
|
||||
// @ts-expect-error ts-migrate(2614) FIXME: Module '"../middlewares/authorization"' has no exp... Remove this comment to see the full error message
|
||||
|
||||
import { isAuthorized } from '../middlewares/authorization';
|
||||
const sendErrorResponse = require('../middlewares/response').sendErrorResponse;
|
||||
const sendItemResponse = require('../middlewares/response').sendItemResponse;
|
||||
@@ -15,7 +15,7 @@ router.post('/:projectId', getUser, isAuthorized, async (req, res) => {
|
||||
try {
|
||||
const { name, teams } = req.body;
|
||||
const { projectId } = req.params;
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'user' does not exist on type 'Request<{ ... Remove this comment to see the full error message
|
||||
|
||||
const userId = req.user.id;
|
||||
|
||||
if (!name) {
|
||||
@@ -43,9 +43,9 @@ router.get(
|
||||
isAuthorized,
|
||||
getSubProjects,
|
||||
async (req, res) => {
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'user' does not exist on type 'Request<{ ... Remove this comment to see the full error message
|
||||
|
||||
const subProjectIds = req.user.subProjects
|
||||
? // @ts-expect-error ts-migrate(2339) FIXME: Property 'user' does not exist on type 'Request<{ ... Remove this comment to see the full error message
|
||||
?
|
||||
req.user.subProjects.map((project: $TSFixMe) => {
|
||||
return { id: project._id, name: project.name };
|
||||
})
|
||||
@@ -53,7 +53,7 @@ router.get(
|
||||
try {
|
||||
const groups = await Promise.all(
|
||||
subProjectIds.map(async (project: $TSFixMe) => {
|
||||
// @ts-expect-error ts-migrate(2554) FIXME: Expected 3 arguments, but got 1.
|
||||
|
||||
const groups = await GroupService.findBy({
|
||||
projectId: project.id,
|
||||
});
|
||||
@@ -94,11 +94,11 @@ router.put('/:projectId/:groupId', getUser, isAuthorized, async (req, res) => {
|
||||
|
||||
const data = {};
|
||||
if (name) {
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'name' does not exist on type '{}'.
|
||||
|
||||
data.name = name;
|
||||
}
|
||||
if (teams) {
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'teams' does not exist on type '{}'.
|
||||
|
||||
data.teams = teams;
|
||||
}
|
||||
|
||||
@@ -120,7 +120,7 @@ router.delete(
|
||||
async (req, res) => {
|
||||
try {
|
||||
const { groupId, projectId } = req.params;
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'user' does not exist on type 'Request<{ ... Remove this comment to see the full error message
|
||||
|
||||
const userId = req.user.id;
|
||||
|
||||
const [deleteGroup] = await Promise.all([
|
||||
|
||||
@@ -12,7 +12,7 @@ import UserService from '../services/userService';
|
||||
import MonitorService from '../services/monitorService';
|
||||
const router = express.Router();
|
||||
|
||||
// @ts-expect-error ts-migrate(2614) FIXME: Module '"../middlewares/authorization"' has no exp... Remove this comment to see the full error message
|
||||
|
||||
import { isAuthorized } from '../middlewares/authorization';
|
||||
import errorService from 'common-server/utils/error';
|
||||
const isUserAdmin = require('../middlewares/project').isUserAdmin;
|
||||
@@ -27,7 +27,7 @@ import subscriberAlertService from '../services/subscriberAlertService';
|
||||
import onCallScheduleStatusService from '../services/onCallScheduleStatusService';
|
||||
import Services from '../utils/services';
|
||||
import joinNames from '../utils/joinNames';
|
||||
// @ts-expect-error ts-migrate(2614) FIXME: Module '"../middlewares/serviceAuthorization"' has... Remove this comment to see the full error message
|
||||
|
||||
import { isAuthorizedService } from '../middlewares/serviceAuthorization';
|
||||
import ErrorService from 'common-server/utils/error';
|
||||
|
||||
@@ -58,7 +58,7 @@ router.post(
|
||||
try {
|
||||
const { incidentId, name, probeId } = req.body;
|
||||
|
||||
// @ts-expect-error ts-migrate(2554) FIXME: Expected 5-7 arguments, but got 4.
|
||||
|
||||
const incident = await IncidentService.acknowledge(
|
||||
incidentId,
|
||||
null,
|
||||
@@ -81,7 +81,7 @@ router.post(
|
||||
try {
|
||||
const { incidentId, name, probeId } = req.body;
|
||||
|
||||
// @ts-expect-error ts-migrate(2554) FIXME: Expected 5-7 arguments, but got 4.
|
||||
|
||||
const incident = await IncidentService.resolve(
|
||||
incidentId,
|
||||
null,
|
||||
@@ -131,16 +131,16 @@ router.post(
|
||||
const description = req.body.description;
|
||||
const customFields = req.body.customFields;
|
||||
const monitors = req.body.monitors;
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'user' does not exist on type 'Request<{ ... Remove this comment to see the full error message
|
||||
|
||||
const userId = req.user
|
||||
? // @ts-expect-error ts-migrate(2339) FIXME: Property 'user' does not exist on type 'Request<{ ... Remove this comment to see the full error message
|
||||
?
|
||||
req.user.id === 'API'
|
||||
? null
|
||||
: // @ts-expect-error ts-migrate(2339) FIXME: Property 'user' does not exist on type 'Request<{ ... Remove this comment to see the full error message
|
||||
:
|
||||
req.user.id
|
||||
: null;
|
||||
let createdByApi = false;
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'user' does not exist on type 'Request<{ ... Remove this comment to see the full error message
|
||||
|
||||
if (req.user && req.user.id === 'API') {
|
||||
createdByApi = true;
|
||||
}
|
||||
@@ -258,7 +258,7 @@ router.post(
|
||||
const end = moment(endDate).toDate();
|
||||
query = {
|
||||
'monitors.monitorId': { $in: [monitorId] },
|
||||
// @ts-expect-error ts-migrate(2322) FIXME: Type '{ 'monitors.monitorId': { $in: string[]; }; ... Remove this comment to see the full error message
|
||||
|
||||
createdAt: { $gte: start, $lte: end },
|
||||
};
|
||||
}
|
||||
@@ -519,19 +519,19 @@ router.get(
|
||||
getSubProjects,
|
||||
async function(req, res) {
|
||||
try {
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'user' does not exist on type 'Request<{ ... Remove this comment to see the full error message
|
||||
|
||||
const subProjectIds = req.user.subProjects
|
||||
? // @ts-expect-error ts-migrate(2339) FIXME: Property 'user' does not exist on type 'Request<{ ... Remove this comment to see the full error message
|
||||
?
|
||||
req.user.subProjects.map((project: $TSFixMe) => project._id)
|
||||
: null;
|
||||
// Call the IncidentService.
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'user' does not exist on type 'Request<{ ... Remove this comment to see the full error message
|
||||
|
||||
const userId = req.user ? req.user.id : null;
|
||||
const { isHome } = req.query;
|
||||
const incident = await IncidentService.getUnresolvedIncidents(
|
||||
subProjectIds,
|
||||
userId,
|
||||
// @ts-expect-error ts-migrate(2345) FIXME: Argument of type 'string | ParsedQs | string[] | P... Remove this comment to see the full error message
|
||||
|
||||
isHome
|
||||
);
|
||||
return sendItemResponse(req, res, incident);
|
||||
@@ -547,16 +547,16 @@ router.post(
|
||||
isAuthorized,
|
||||
async function(req, res) {
|
||||
try {
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'user' does not exist on type 'Request<{ ... Remove this comment to see the full error message
|
||||
|
||||
const userId = req.user
|
||||
? // @ts-expect-error ts-migrate(2339) FIXME: Property 'user' does not exist on type 'Request<{ ... Remove this comment to see the full error message
|
||||
?
|
||||
req.user.id === 'API'
|
||||
? null
|
||||
: // @ts-expect-error ts-migrate(2339) FIXME: Property 'user' does not exist on type 'Request<{ ... Remove this comment to see the full error message
|
||||
:
|
||||
req.user.id
|
||||
: null;
|
||||
let acknowledgedByApi = false;
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'user' does not exist on type 'Request<{ ... Remove this comment to see the full error message
|
||||
|
||||
if (req.user && req.user.id === 'API') {
|
||||
acknowledgedByApi = true;
|
||||
}
|
||||
@@ -566,11 +566,11 @@ router.post(
|
||||
const incident = await IncidentService.acknowledge(
|
||||
incidentId,
|
||||
userId,
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'user' does not exist on type 'Request<{ ... Remove this comment to see the full error message
|
||||
|
||||
req.user.name,
|
||||
null,
|
||||
null,
|
||||
// @ts-expect-error ts-migrate(2345) FIXME: Argument of type 'null' is not assignable to param... Remove this comment to see the full error message
|
||||
|
||||
null,
|
||||
acknowledgedByApi
|
||||
);
|
||||
@@ -717,16 +717,16 @@ router.post(
|
||||
isAuthorized,
|
||||
async function(req, res) {
|
||||
try {
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'user' does not exist on type 'Request<{ ... Remove this comment to see the full error message
|
||||
|
||||
const userId = req.user
|
||||
? // @ts-expect-error ts-migrate(2339) FIXME: Property 'user' does not exist on type 'Request<{ ... Remove this comment to see the full error message
|
||||
?
|
||||
req.user.id === 'API'
|
||||
? null
|
||||
: // @ts-expect-error ts-migrate(2339) FIXME: Property 'user' does not exist on type 'Request<{ ... Remove this comment to see the full error message
|
||||
:
|
||||
req.user.id
|
||||
: null;
|
||||
let resolvedByApi = false;
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'user' does not exist on type 'Request<{ ... Remove this comment to see the full error message
|
||||
|
||||
if (req.user && req.user.id === 'API') {
|
||||
resolvedByApi = true;
|
||||
}
|
||||
@@ -739,7 +739,7 @@ router.post(
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
// @ts-expect-error ts-migrate(2345) FIXME: Argument of type 'null' is not assignable to param... Remove this comment to see the full error message
|
||||
|
||||
null,
|
||||
resolvedByApi
|
||||
);
|
||||
@@ -883,7 +883,7 @@ router.post(
|
||||
isAuthorized,
|
||||
async function(req, res) {
|
||||
try {
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'user' does not exist on type 'Request<{ ... Remove this comment to see the full error message
|
||||
|
||||
const userId = req.user ? req.user.id : null;
|
||||
const { incidentId } = req.params;
|
||||
// Call the IncidentService
|
||||
@@ -984,7 +984,7 @@ router.post(
|
||||
});
|
||||
const idNumber = incident.idNumber;
|
||||
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'user' does not exist on type 'Request<{ ... Remove this comment to see the full error message
|
||||
|
||||
const userId = req.user.id;
|
||||
if (!data.content) {
|
||||
return sendErrorResponse(req, res, {
|
||||
@@ -1081,7 +1081,7 @@ router.post(
|
||||
|
||||
// handle creation or updating
|
||||
if (!data.id) {
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'user' does not exist on type 'Request<{ ... Remove this comment to see the full error message
|
||||
|
||||
data.createdById = req.user.id;
|
||||
data.monitors = incident.monitors.map(
|
||||
(monitor: $TSFixMe) => monitor.monitorId
|
||||
@@ -1218,7 +1218,7 @@ router.post(
|
||||
}),
|
||||
IncidentTimelineService.create({
|
||||
incidentId: incident._id,
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'user' does not exist on type 'Request<{ ... Remove this comment to see the full error message
|
||||
|
||||
createdById: req.user.id,
|
||||
incident_state: data.incident_state,
|
||||
status,
|
||||
@@ -1333,9 +1333,9 @@ router.get(
|
||||
count,
|
||||
} = await StatusPageService.getStatusPagesForIncident(
|
||||
incident._id,
|
||||
// @ts-expect-error ts-migrate(2345) FIXME: Argument of type 'string | ParsedQs | string[] | P... Remove this comment to see the full error message
|
||||
|
||||
parseInt(req.query.skip) || 0,
|
||||
// @ts-expect-error ts-migrate(2345) FIXME: Argument of type 'string | ParsedQs | string[] | P... Remove this comment to see the full error message
|
||||
|
||||
parseInt(req.query.limit) || 10
|
||||
);
|
||||
return sendListResponse(req, res, statusPages, count);
|
||||
@@ -1378,7 +1378,7 @@ router.delete(
|
||||
_id: incidentMessageId,
|
||||
incidentId,
|
||||
},
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'user' does not exist on type 'Request<{ ... Remove this comment to see the full error message
|
||||
|
||||
req.user.id
|
||||
),
|
||||
]);
|
||||
@@ -1467,7 +1467,7 @@ router.delete(
|
||||
}),
|
||||
IncidentTimelineService.create({
|
||||
incidentId,
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'user' does not exist on type 'Request<{ ... Remove this comment to see the full error message
|
||||
|
||||
createdById: req.user.id,
|
||||
status,
|
||||
}),
|
||||
@@ -1562,9 +1562,9 @@ router.get(
|
||||
let skip = 0,
|
||||
limit = 0;
|
||||
if (type === 'investigation') {
|
||||
// @ts-expect-error ts-migrate(2322) FIXME: Type 'string | ParsedQs | 0 | string[] | ParsedQs[... Remove this comment to see the full error message
|
||||
|
||||
skip = req.query.skip || 0;
|
||||
// @ts-expect-error ts-migrate(2322) FIXME: Type 'string | ParsedQs | string[] | 10 | ParsedQs... Remove this comment to see the full error message
|
||||
|
||||
limit = req.query.limit || 10;
|
||||
}
|
||||
|
||||
@@ -1691,7 +1691,7 @@ router.get(
|
||||
...callScheduleStatus,
|
||||
];
|
||||
incidentMessages.sort(
|
||||
// @ts-expect-error ts-migrate(2345) FIXME: Argument of type '(a: any, b: any) => number | fal... Remove this comment to see the full error message
|
||||
|
||||
(a, b) =>
|
||||
typeof a.schedule !== 'object' &&
|
||||
b.createdAt - a.createdAt
|
||||
@@ -1702,7 +1702,7 @@ router.get(
|
||||
a.status !== 'internal notes updated'
|
||||
);
|
||||
|
||||
// @ts-expect-error ts-migrate(2345) FIXME: Argument of type 'any[]' is not assignable to para... Remove this comment to see the full error message
|
||||
|
||||
result = await Services.rearrangeDuty(filteredMsg);
|
||||
}
|
||||
}
|
||||
@@ -1721,7 +1721,7 @@ router.delete('/:projectId/:incidentId', getUser, isUserAdmin, async function(
|
||||
const { projectId, incidentId } = req.params;
|
||||
const incident = await IncidentService.deleteBy(
|
||||
{ _id: incidentId, projectId },
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'user' does not exist on type 'Request<{ ... Remove this comment to see the full error message
|
||||
|
||||
req.user.id
|
||||
);
|
||||
if (incident) {
|
||||
@@ -1774,7 +1774,7 @@ router.get(
|
||||
isAuthorized,
|
||||
async function(req, res) {
|
||||
try {
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'user' does not exist on type 'Request<{ ... Remove this comment to see the full error message
|
||||
|
||||
const userId = req.user ? req.user.id : null;
|
||||
|
||||
// get incident properties to build url
|
||||
@@ -1786,7 +1786,7 @@ router.get(
|
||||
select: 'idNumber projectId slug',
|
||||
populate: [{ path: 'projectId', select: 'slug' }],
|
||||
}),
|
||||
// @ts-expect-error ts-migrate(2554) FIXME: Expected 5-7 arguments, but got 2.
|
||||
|
||||
IncidentService.resolve(incidentId, userId),
|
||||
]);
|
||||
|
||||
@@ -1797,9 +1797,9 @@ router.get(
|
||||
title_message: 'Incident Resolved',
|
||||
body_message: 'Your incident is now resolved.',
|
||||
action: 'resolve',
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'dashboardHost' does not exist on type 'G... Remove this comment to see the full error message
|
||||
|
||||
dashboard_url: `${global.dashboardHost}/project/${project.slug}/incidents/${incident.slug}`,
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'apiHost' does not exist on type 'Global ... Remove this comment to see the full error message
|
||||
|
||||
apiUrl: global.apiHost,
|
||||
});
|
||||
} catch (error) {
|
||||
@@ -1820,7 +1820,7 @@ router.get(
|
||||
isAuthorized,
|
||||
async function(req, res) {
|
||||
try {
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'user' does not exist on type 'Request<{ ... Remove this comment to see the full error message
|
||||
|
||||
const userId = req.user ? req.user.id : null;
|
||||
|
||||
// get incident properties to build url
|
||||
@@ -1832,7 +1832,7 @@ router.get(
|
||||
select: 'idNumber projectId slug',
|
||||
populate: [{ path: 'projectId', select: 'slug' }],
|
||||
}),
|
||||
// @ts-expect-error ts-migrate(2554) FIXME: Expected 5-7 arguments, but got 3.
|
||||
|
||||
IncidentService.acknowledge(incidentId, userId, req.user.name),
|
||||
]);
|
||||
|
||||
@@ -1843,9 +1843,9 @@ router.get(
|
||||
title_message: 'Incident Acknowledged',
|
||||
body_message: 'Your incident is now acknowledged.',
|
||||
action: 'acknowledge',
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'dashboardHost' does not exist on type 'G... Remove this comment to see the full error message
|
||||
|
||||
dashboard_url: `${global.dashboardHost}/project/${project.slug}/incidents/${incident.slug}`,
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'apiHost' does not exist on type 'Global ... Remove this comment to see the full error message
|
||||
|
||||
apiUrl: global.apiHost,
|
||||
});
|
||||
} catch (error) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import express from 'express';
|
||||
const getUser = require('../middlewares/user').getUser;
|
||||
// @ts-expect-error ts-migrate(2614) FIXME: Module '"../middlewares/authorization"' has no exp... Remove this comment to see the full error message
|
||||
|
||||
import { isAuthorized } from '../middlewares/authorization';
|
||||
const sendErrorResponse = require('../middlewares/response').sendErrorResponse;
|
||||
const sendItemResponse = require('../middlewares/response').sendItemResponse;
|
||||
@@ -48,28 +48,28 @@ router.post('/:projectId', getUser, isAuthorized, async function(req, res) {
|
||||
|
||||
if (!name || !name.trim()) {
|
||||
const error = new Error('SLA name is required');
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'code' does not exist on type 'Error'.
|
||||
|
||||
error.code = 400;
|
||||
return sendErrorResponse(req, res, error);
|
||||
}
|
||||
|
||||
if (duration && isNaN(duration)) {
|
||||
const error = new Error('Please use numeric values for duration');
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'code' does not exist on type 'Error'.
|
||||
|
||||
error.code = 400;
|
||||
return sendErrorResponse(req, res, error);
|
||||
}
|
||||
|
||||
if (!alertTime || !alertTime.trim()) {
|
||||
const error = new Error('Please set alert time for this SLA');
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'code' does not exist on type 'Error'.
|
||||
|
||||
error.code = 400;
|
||||
return sendErrorResponse(req, res, error);
|
||||
}
|
||||
|
||||
if (isNaN(alertTime)) {
|
||||
const error = new Error('Please use numeric values for alert time');
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'code' does not exist on type 'Error'.
|
||||
|
||||
error.code = 400;
|
||||
return sendErrorResponse(req, res, error);
|
||||
}
|
||||
@@ -78,7 +78,7 @@ router.post('/:projectId', getUser, isAuthorized, async function(req, res) {
|
||||
const error = new Error(
|
||||
'Alert time should be always less than duration'
|
||||
);
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'code' does not exist on type 'Error'.
|
||||
|
||||
error.code = 400;
|
||||
return sendErrorResponse(req, res, error);
|
||||
}
|
||||
@@ -102,28 +102,28 @@ router.put('/:projectId/:incidentSlaId', getUser, isAuthorized, async function(
|
||||
|
||||
if (!handleDefault && (!name || !name.trim())) {
|
||||
const error = new Error('SLA name is required');
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'code' does not exist on type 'Error'.
|
||||
|
||||
error.code = 400;
|
||||
return sendErrorResponse(req, res, error);
|
||||
}
|
||||
|
||||
if (!handleDefault && duration && isNaN(duration)) {
|
||||
const error = new Error('Please use numeric values for duration');
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'code' does not exist on type 'Error'.
|
||||
|
||||
error.code = 400;
|
||||
return sendErrorResponse(req, res, error);
|
||||
}
|
||||
|
||||
if (!handleDefault && (!alertTime || !alertTime.trim())) {
|
||||
const error = new Error('Please set alert time for this SLA');
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'code' does not exist on type 'Error'.
|
||||
|
||||
error.code = 400;
|
||||
return sendErrorResponse(req, res, error);
|
||||
}
|
||||
|
||||
if (!handleDefault && isNaN(alertTime)) {
|
||||
const error = new Error('Please use numeric values for alert time');
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'code' does not exist on type 'Error'.
|
||||
|
||||
error.code = 400;
|
||||
return sendErrorResponse(req, res, error);
|
||||
}
|
||||
@@ -132,7 +132,7 @@ router.put('/:projectId/:incidentSlaId', getUser, isAuthorized, async function(
|
||||
const error = new Error(
|
||||
'Alert time should be always less than duration'
|
||||
);
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'code' does not exist on type 'Error'.
|
||||
|
||||
error.code = 400;
|
||||
return sendErrorResponse(req, res, error);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import express from 'express';
|
||||
const router = express.Router();
|
||||
const getUser = require('../middlewares/user').getUser;
|
||||
// @ts-expect-error ts-migrate(2614) FIXME: Module '"../middlewares/authorization"' has no exp... Remove this comment to see the full error message
|
||||
|
||||
import { isAuthorized } from '../middlewares/authorization';
|
||||
const sendErrorResponse = require('../middlewares/response').sendErrorResponse;
|
||||
const sendItemResponse = require('../middlewares/response').sendItemResponse;
|
||||
@@ -15,25 +15,25 @@ router.post('/:projectId', getUser, isAuthorized, async function(req, res) {
|
||||
|
||||
if (!projectId) {
|
||||
const error = new Error('Project Id must be present');
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'code' does not exist on type 'Error'.
|
||||
|
||||
error.code = 400;
|
||||
throw error;
|
||||
}
|
||||
if (!name) {
|
||||
const error = new Error('Name must be present');
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'code' does not exist on type 'Error'.
|
||||
|
||||
error.code = 400;
|
||||
throw error;
|
||||
}
|
||||
if (!incidentState) {
|
||||
const error = new Error('Incident state must be present');
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'code' does not exist on type 'Error'.
|
||||
|
||||
error.code = 400;
|
||||
throw error;
|
||||
}
|
||||
if (!incidentNote) {
|
||||
const error = new Error('Incident note must be present');
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'code' does not exist on type 'Error'.
|
||||
|
||||
error.code = 400;
|
||||
throw error;
|
||||
}
|
||||
@@ -61,7 +61,7 @@ router.get('/:projectId', getUser, isAuthorized, async function(req, res) {
|
||||
|
||||
if (!projectId) {
|
||||
const error = new Error('Project Id must be present');
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'code' does not exist on type 'Error'.
|
||||
|
||||
error.code = 400;
|
||||
throw error;
|
||||
}
|
||||
@@ -92,7 +92,7 @@ router.put('/:projectId/:templateId', getUser, isAuthorized, async function(
|
||||
|
||||
if (!projectId) {
|
||||
const error = new Error('Project Id must be present');
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'code' does not exist on type 'Error'.
|
||||
|
||||
error.code = 400;
|
||||
throw error;
|
||||
}
|
||||
@@ -100,25 +100,25 @@ router.put('/:projectId/:templateId', getUser, isAuthorized, async function(
|
||||
const error = new Error(
|
||||
'Incident note template Id must be present'
|
||||
);
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'code' does not exist on type 'Error'.
|
||||
|
||||
error.code = 400;
|
||||
throw error;
|
||||
}
|
||||
if (!name) {
|
||||
const error = new Error('Name must be present');
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'code' does not exist on type 'Error'.
|
||||
|
||||
error.code = 400;
|
||||
throw error;
|
||||
}
|
||||
if (!incidentState) {
|
||||
const error = new Error('Incident state must be present');
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'code' does not exist on type 'Error'.
|
||||
|
||||
error.code = 400;
|
||||
throw error;
|
||||
}
|
||||
if (!incidentNote) {
|
||||
const error = new Error('Incident note must be present');
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'code' does not exist on type 'Error'.
|
||||
|
||||
error.code = 400;
|
||||
throw error;
|
||||
}
|
||||
@@ -144,7 +144,7 @@ router.delete('/:projectId/:templateId', getUser, isAuthorized, async function(
|
||||
|
||||
if (!projectId) {
|
||||
const error = new Error('Project Id must be present');
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'code' does not exist on type 'Error'.
|
||||
|
||||
error.code = 400;
|
||||
throw error;
|
||||
}
|
||||
@@ -152,7 +152,7 @@ router.delete('/:projectId/:templateId', getUser, isAuthorized, async function(
|
||||
const error = new Error(
|
||||
'Incident note template Id must be present'
|
||||
);
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'code' does not exist on type 'Error'.
|
||||
|
||||
error.code = 400;
|
||||
throw error;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import express from 'express';
|
||||
const router = express.Router();
|
||||
const getUser = require('../middlewares/user').getUser;
|
||||
// @ts-expect-error ts-migrate(2614) FIXME: Module '"../middlewares/authorization"' has no exp... Remove this comment to see the full error message
|
||||
|
||||
import { isAuthorized } from '../middlewares/authorization';
|
||||
const sendErrorResponse = require('../middlewares/response').sendErrorResponse;
|
||||
const sendListResponse = require('../middlewares/response').sendListResponse;
|
||||
@@ -23,7 +23,7 @@ router.get('/:projectId', getUser, isAuthorized, async function(req, res) {
|
||||
const [IncidentPriorities, count] = await Promise.all([
|
||||
IncidentPrioritiesService.findBy(
|
||||
{ query: { projectId }, select: selectIncPriority },
|
||||
// @ts-expect-error ts-migrate(2554) FIXME: Expected 1 arguments, but got 3.
|
||||
|
||||
limit,
|
||||
skip
|
||||
),
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
import express from 'express';
|
||||
const router = express.Router();
|
||||
const getUser = require('../middlewares/user').getUser;
|
||||
// @ts-expect-error ts-migrate(2614) FIXME: Module '"../middlewares/authorization"' has no exp... Remove this comment to see the full error message
|
||||
|
||||
import { isAuthorized } from '../middlewares/authorization';
|
||||
const sendErrorResponse = require('../middlewares/response').sendErrorResponse;
|
||||
const sendItemResponse = require('../middlewares/response').sendItemResponse;
|
||||
const sendListResponse = require('../middlewares/response').sendListResponse;
|
||||
import IncidentSettingsService from '../services/incidentSettingsService';
|
||||
import IncidentPrioritiesService from '../services/incidentPrioritiesService';
|
||||
// @ts-expect-error ts-migrate(2614) FIXME: Module '"../config/incidentDefaultSettings"' has n... Remove this comment to see the full error message
|
||||
|
||||
import { variables } from '../config/incidentDefaultSettings';
|
||||
|
||||
router.get('/variables', async function(req, res) {
|
||||
@@ -28,7 +28,7 @@ router.get('/:projectId/default', getUser, isAuthorized, async function(
|
||||
const { projectId } = req.params;
|
||||
if (!projectId) {
|
||||
const error = new Error('Project Id must be present');
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'code' does not exist on type 'Error'.
|
||||
|
||||
error.code = 400;
|
||||
throw error;
|
||||
}
|
||||
@@ -55,7 +55,7 @@ router.get('/:projectId', getUser, isAuthorized, async function(req, res) {
|
||||
|
||||
if (!projectId) {
|
||||
const error = new Error('Project Id must be present');
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'code' does not exist on type 'Error'.
|
||||
|
||||
error.code = 400;
|
||||
throw error;
|
||||
}
|
||||
@@ -187,13 +187,13 @@ router.delete('/:projectId/:templateId', getUser, isAuthorized, async function(
|
||||
|
||||
if (!projectId) {
|
||||
const error = new Error('Project Id must be present');
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'code' does not exist on type 'Error'.
|
||||
|
||||
error.code = 400;
|
||||
throw error;
|
||||
}
|
||||
if (!templateId) {
|
||||
const error = new Error('Incident settings Id must be present.');
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'code' does not exist on type 'Error'.
|
||||
|
||||
error.code = 400;
|
||||
throw error;
|
||||
}
|
||||
@@ -222,25 +222,25 @@ router.post('/:projectId', getUser, isAuthorized, async function(req, res) {
|
||||
|
||||
if (!projectId) {
|
||||
const error = new Error('Project Id must be present');
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'code' does not exist on type 'Error'.
|
||||
|
||||
error.code = 400;
|
||||
throw error;
|
||||
}
|
||||
if (!name) {
|
||||
const error = new Error('Name must be present');
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'code' does not exist on type 'Error'.
|
||||
|
||||
error.code = 400;
|
||||
throw error;
|
||||
}
|
||||
if (!title) {
|
||||
const error = new Error('Title must be present');
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'code' does not exist on type 'Error'.
|
||||
|
||||
error.code = 400;
|
||||
throw error;
|
||||
}
|
||||
if (!incidentPriority) {
|
||||
const error = new Error('Incident priority must be present');
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'code' does not exist on type 'Error'.
|
||||
|
||||
error.code = 400;
|
||||
throw error;
|
||||
}
|
||||
@@ -251,7 +251,7 @@ router.post('/:projectId', getUser, isAuthorized, async function(req, res) {
|
||||
});
|
||||
if (!priority) {
|
||||
const error = new Error("Incident priority doesn't exist.");
|
||||
// @ts-expect-error ts-migrate(2339) FIXME: Property 'code' does not exist on type 'Error'.
|
||||
|
||||
error.code = 400;
|
||||
throw error;
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ const router = express.Router();
|
||||
import ProbeService from '../services/probeService';
|
||||
const sendErrorResponse = require('../middlewares/response').sendErrorResponse;
|
||||
const sendItemResponse = require('../middlewares/response').sendItemResponse;
|
||||
// @ts-expect-error ts-migrate(2614) FIXME: Module '"../middlewares/api"' has no exported memb... Remove this comment to see the full error message
|
||||
|
||||
import { isValidMonitor } from '../middlewares/api';
|
||||
|
||||
const incomingHttpRequest = async function(req: $TSFixMe, res: $TSFixMe) {
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user