mirror of
https://github.com/OneUptime/oneuptime
synced 2024-11-22 15:24:55 +00:00
fix
This commit is contained in:
parent
339d06f4e8
commit
15bedb021b
@ -8,8 +8,8 @@ const secondsToHms: Function = (value: $TSFixMe): void => {
|
||||
if (!isNaN(value)) {
|
||||
value = Number(value);
|
||||
const hr: $TSFixMe = Math.floor(value / 3600),
|
||||
min = Math.floor((value % 3600) / 60),
|
||||
sec = Math.floor((value % 3600) % 60);
|
||||
min: $TSFixMe = Math.floor((value % 3600) / 60),
|
||||
sec: $TSFixMe = Math.floor((value % 3600) % 60);
|
||||
|
||||
const formattedValue: string = `${hr > 0 ? `${hr} hr` : ''} ${
|
||||
min > 0
|
||||
|
@ -1,5 +1,5 @@
|
||||
export default {
|
||||
deduplicate: async (acc: $TSFixMe = []) => {
|
||||
deduplicate: async (arr: $TSFixMe = []) => {
|
||||
const map: $TSFixMe = {};
|
||||
|
||||
let curr: $TSFixMe;
|
||||
@ -18,7 +18,7 @@ export default {
|
||||
return Object.values(map);
|
||||
},
|
||||
|
||||
rearrangeDuty: async (acc: $TSFixMe = []) => {
|
||||
rearrangeDuty: async (main: $TSFixMe = []) => {
|
||||
let closeStringId: $TSFixMe;
|
||||
for (let i: $TSFixMe = 0; i < main.length; i++) {
|
||||
if (typeof main[i].schedule == 'object') {
|
||||
|
@ -13,7 +13,7 @@ export default class Hostname {
|
||||
}
|
||||
}
|
||||
|
||||
toString(): string {
|
||||
public toString(): string {
|
||||
return this.hostname;
|
||||
}
|
||||
}
|
||||
|
@ -13,7 +13,7 @@ export default class Route {
|
||||
}
|
||||
}
|
||||
|
||||
toString(): string {
|
||||
public toString(): string {
|
||||
return this.route;
|
||||
}
|
||||
}
|
||||
|
@ -19,7 +19,7 @@ export default class Email {
|
||||
this.email = email;
|
||||
}
|
||||
|
||||
toString(): string {
|
||||
public toString(): string {
|
||||
return this.email;
|
||||
}
|
||||
}
|
||||
|
@ -9,7 +9,7 @@ import { sendErrorResponse } from '../Utils/Response';
|
||||
import BadDataException from 'Common/Types/Exception/BadDataException';
|
||||
|
||||
export default class ClusterKeyAuthorization {
|
||||
public static async isAuthorizedService(
|
||||
public static async isAuthorizedService(
|
||||
req: ExpressRequest,
|
||||
res: ExpressResponse,
|
||||
next: NextFunction
|
||||
@ -36,7 +36,7 @@ public static async isAuthorizedService(
|
||||
);
|
||||
}
|
||||
|
||||
const isAuthorized: $TSFixMe = clusterKey: $TSFixMe === CLUSTER_KEY;
|
||||
const isAuthorized: $TSFixMe = clusterKey === CLUSTER_KEY;
|
||||
|
||||
if (!isAuthorized) {
|
||||
return sendErrorResponse(
|
||||
|
@ -343,7 +343,7 @@ public async sendRealTimeUpdate({ incidentId, projectId }: $TSFixMe): void {
|
||||
...timeline,
|
||||
...alerts,
|
||||
...incidentMessages,
|
||||
].sort((a: $TSFixMe, b: $TSFixMe){
|
||||
].sort((a: $TSFixMe, b: $TSFixMe) => {
|
||||
return b.createdAt - a.createdAt;
|
||||
});
|
||||
incidentMessages = [
|
||||
|
@ -13,7 +13,7 @@ import Query from '../Types/DB/Query';
|
||||
import errorService from '../Utils/error';
|
||||
|
||||
export default class Service {
|
||||
public async create({ domain, projectId }: $TSFixMe): void {
|
||||
public async create({ domain, projectId }: $TSFixMe): void {
|
||||
const parsed: $TSFixMe = psl.parse(domain);
|
||||
const token: string = 'oneuptime=' + randomChar();
|
||||
|
||||
@ -28,7 +28,14 @@ public async create({ domain, projectId }: $TSFixMe): void {
|
||||
return await DomainVerificationTokenModel.create(creationData);
|
||||
}
|
||||
|
||||
public async findBy({ query, limit, skip, populate, select, sort }: FindBy): void {
|
||||
public async findBy({
|
||||
query,
|
||||
limit,
|
||||
skip,
|
||||
populate,
|
||||
select,
|
||||
sort,
|
||||
}: FindBy): void {
|
||||
if (!skip) {
|
||||
skip = 0;
|
||||
}
|
||||
@ -61,7 +68,9 @@ public async findBy({ query, limit, skip, populate, select, sort }: FindBy): voi
|
||||
query: { parentProjectId: query.projectId },
|
||||
select: '_id',
|
||||
});
|
||||
subProjects = subProjects.map((project: $TSFixMe) => project._id); // grab just the project ids
|
||||
subProjects = subProjects.map((project: $TSFixMe) => {
|
||||
return project._id;
|
||||
}); // grab just the project ids
|
||||
const totalProjects: $TSFixMe = [query.projectId, ...subProjects];
|
||||
|
||||
query = { ...query, projectId: { $in: totalProjects } };
|
||||
@ -79,7 +88,7 @@ public async findBy({ query, limit, skip, populate, select, sort }: FindBy): voi
|
||||
return domains;
|
||||
}
|
||||
|
||||
public async resetDomain(domain: $TSFixMe): void {
|
||||
public async resetDomain(domain: $TSFixMe): void {
|
||||
const updateObj: $TSFixMe = {
|
||||
verificationToken: 'oneuptime=' + randomChar(),
|
||||
verified: false,
|
||||
@ -92,7 +101,7 @@ public async resetDomain(domain: $TSFixMe): void {
|
||||
return updatedDomain;
|
||||
}
|
||||
|
||||
public async doesTxtRecordExist(
|
||||
public async doesTxtRecordExist(
|
||||
subDomain: $TSFixMe,
|
||||
verificationToken: $TSFixMe
|
||||
): void {
|
||||
@ -110,9 +119,9 @@ public async doesTxtRecordExist(
|
||||
// records is an array of arrays
|
||||
// flatten the array to a single array
|
||||
const txtRecords: $TSFixMe = flatten(records);
|
||||
const result: $TSFixMe = txtRecords.some(
|
||||
txtRecord => verificationToken === txtRecord
|
||||
);
|
||||
const result: $TSFixMe = txtRecords.some((txtRecord: $TSFixMe) => {
|
||||
return verificationToken === txtRecord;
|
||||
});
|
||||
|
||||
if (result) {
|
||||
return { result, txtRecords };
|
||||
@ -123,9 +132,9 @@ public async doesTxtRecordExist(
|
||||
// records is an array of arrays
|
||||
// flatten the array to a single array
|
||||
const txtRecords: $TSFixMe = flatten(records);
|
||||
const result: $TSFixMe = txtRecords.some(
|
||||
txtRecord => verificationToken === txtRecord
|
||||
);
|
||||
const result: $TSFixMe = txtRecords.some((txtRecord: $TSFixMe) => {
|
||||
return verificationToken === txtRecord;
|
||||
});
|
||||
|
||||
return { result, txtRecords };
|
||||
}
|
||||
@ -149,7 +158,7 @@ public async doesTxtRecordExist(
|
||||
}
|
||||
}
|
||||
|
||||
public async doesDomainBelongToProject(
|
||||
public async doesDomainBelongToProject(
|
||||
projectId: ObjectID,
|
||||
subDomain: $TSFixMe
|
||||
): void {
|
||||
@ -183,11 +192,15 @@ public async doesDomainBelongToProject(
|
||||
select: '_id',
|
||||
});
|
||||
}
|
||||
subProjects = subProjects.map((project: $TSFixMe) => project._id); // grab just the project ids
|
||||
subProjects = subProjects.map((project: $TSFixMe) => {
|
||||
return project._id;
|
||||
}); // grab just the project ids
|
||||
projectList.push(...subProjects);
|
||||
|
||||
projectList = projectList.filter(
|
||||
(projectId: $TSFixMe, index: $TSFixMe)projectList.indexOf(projectId) === index
|
||||
(projectId: $TSFixMe, index: $TSFixMe) => {
|
||||
return projectList.indexOf(projectId) === index;
|
||||
}
|
||||
);
|
||||
|
||||
const parsed: $TSFixMe = psl.parse(subDomain);
|
||||
@ -213,7 +226,7 @@ public async doesDomainBelongToProject(
|
||||
return false;
|
||||
}
|
||||
|
||||
public async deleteBy(query: Query): void {
|
||||
public async deleteBy(query: Query): void {
|
||||
const domainCount: $TSFixMe = await this.countBy(query);
|
||||
|
||||
if (!domainCount || domainCount === 0) {
|
||||
@ -262,7 +275,7 @@ public async deleteBy(query: Query): void {
|
||||
return domain;
|
||||
}
|
||||
|
||||
public async findDomain(domainId: $TSFixMe, projectArr = []): void {
|
||||
public async findDomain(domainId: $TSFixMe, projectArr = []): void {
|
||||
let projectId: $TSFixMe;
|
||||
for (const pId of projectArr) {
|
||||
const populateDomainVerify: $TSFixMe = [
|
||||
|
@ -618,7 +618,7 @@ export default class Service {
|
||||
return updatedData;
|
||||
}
|
||||
|
||||
async _sendIncidentCreatedAlert(incident: $TSFixMe): void {
|
||||
public async _sendIncidentCreatedAlert(incident: $TSFixMe): void {
|
||||
ZapierService.pushToZapier('incident_created', incident);
|
||||
// await RealTimeService.sendCreatedIncident(incident);
|
||||
|
||||
@ -1639,7 +1639,7 @@ export default class Service {
|
||||
}
|
||||
}
|
||||
|
||||
clearInterval(incidentId: $TSFixMe): void {
|
||||
public clearInterval(incidentId: $TSFixMe): void {
|
||||
intervals = intervals.filter((interval: $TSFixMe) => {
|
||||
if (String(interval.incidentId) === String(incidentId)) {
|
||||
clearInterval(interval.intervalId);
|
||||
|
@ -1346,8 +1346,9 @@ export default class Service {
|
||||
for (const field of incidentCustomFields) {
|
||||
const filterCriteria: $TSFixMe =
|
||||
filter.filterCriteria,
|
||||
filterCondition = filter.filterCondition,
|
||||
filterText = filter.filterText;
|
||||
filterCondition: $TSFixMe =
|
||||
filter.filterCondition,
|
||||
filterText: $TSFixMe = filter.filterText;
|
||||
|
||||
if (
|
||||
filterCriteria &&
|
||||
@ -1558,7 +1559,7 @@ export default class Service {
|
||||
subProjectIds.push(incomingRequest.projectId);
|
||||
|
||||
const resolveResponse: $TSFixMe = [],
|
||||
acknowledgeResponse = [],
|
||||
acknowledgeResponse: $TSFixMe = [],
|
||||
resolvedIncidents: $TSFixMe = [],
|
||||
acknowledgedIncidents: $TSFixMe = [];
|
||||
|
||||
|
@ -1707,7 +1707,7 @@ export default class Service {
|
||||
}
|
||||
|
||||
// checks if the monitor uptime stat is within the defined uptime on monitor sla
|
||||
// then update the monitor => breachedMonitorSla
|
||||
// then update the (monitor: $TSFixMe) => breachedMonitorSla
|
||||
public async updateMonitorSlaStat(query: Query): void {
|
||||
const currentDate: $TSFixMe = moment().format();
|
||||
let startDate: $TSFixMe = moment(currentDate).subtract(30, 'days'); // default frequency
|
||||
|
@ -416,7 +416,7 @@ function calcAvgTime(metric: $TSFixMe): void {
|
||||
const length: $TSFixMe = metric.length;
|
||||
|
||||
let avgTimeCount: $TSFixMe = 0,
|
||||
avgMaxTimeCount = 0;
|
||||
avgMaxTimeCount: $TSFixMe = 0;
|
||||
metric.forEach((data: $TSFixMe) => {
|
||||
avgTimeCount += data.metrics.avgTime;
|
||||
avgMaxTimeCount += data.metrics.maxTime;
|
||||
|
@ -205,7 +205,7 @@ public async saveMonitorLog(data: $TSFixMe): void {
|
||||
select: '_id',
|
||||
});
|
||||
|
||||
const incidentIds: $TSFixMe = incidents.map(incident: $TSFixMe => incident._id);
|
||||
const incidentIds: $TSFixMe = incidents.map((incident: $TSFixMe) => incident._id);
|
||||
|
||||
if (incidentIds && incidentIds.length) {
|
||||
log = await MonitorLogService.updateOneBy(
|
||||
|
@ -439,7 +439,7 @@ public async findsubProjectId(projectId: $TSFixMe): void {
|
||||
select: '_id',
|
||||
});
|
||||
|
||||
const subProjectId: $TSFixMe = subProject.map(sub: $TSFixMe => String(sub._id));
|
||||
const subProjectId: $TSFixMe = subProject.map((sub: $TSFixMe) => String(sub._id));
|
||||
const projectIdArr: $TSFixMe = [projectId, ...subProjectId];
|
||||
return projectIdArr;
|
||||
}
|
||||
@ -662,9 +662,9 @@ public async getUserProjects(userId, skip, limit): void {
|
||||
|
||||
.map((project: $TSFixMe) => (project.parentProjectId ? project : null))
|
||||
|
||||
.filter(subProject => subProject !== null);
|
||||
.filter((subProject: $TSFixMe) => subProject !== null);
|
||||
parentProjectIds = subProjects.map(
|
||||
subProject =>
|
||||
(subProject: $TSFixMe) =>
|
||||
subProject.parentProjectId._id || subProject.parentProjectId
|
||||
);
|
||||
const projects: $TSFixMe = userProjects
|
||||
|
@ -927,7 +927,7 @@ public async updateTeamMemberRole(
|
||||
const teams: $TSFixMe = response.map(res: $TSFixMe => res.team);
|
||||
const flatTeams: $TSFixMe = flatten(teams);
|
||||
const teamArr: $TSFixMe = flatTeams.filter(
|
||||
team => String(team.userId) === String(teamMemberUserId)
|
||||
(team: $TSFixMe) => String(team.userId) === String(teamMemberUserId)
|
||||
);
|
||||
const checkCurrentViewer: $TSFixMe = teamArr.every(
|
||||
(data: $TSFixMe) => data.role === 'Viewer'
|
||||
|
@ -168,7 +168,7 @@ export const getContainerSecuritiesFailure: Function = (
|
||||
export const getContainerSecurities: $TSFixMe = ({
|
||||
projectId,
|
||||
componentId,
|
||||
skip: number = 0
|
||||
skip = 0
|
||||
limit = 0,
|
||||
fetchingPage = false,
|
||||
}: $TSFixMe) => {
|
||||
|
@ -35,7 +35,7 @@ export const resetSubProjects: Function = (): void => {
|
||||
export const getSubProjects: Function = (
|
||||
projectId: ObjectID,
|
||||
skip: number = 0
|
||||
limit = 10
|
||||
limit: $TSFixMe = 10
|
||||
): void => {
|
||||
return function (dispatch: Dispatch): void {
|
||||
const promise: $TSFixMe = BackendAPI.get(
|
||||
|
@ -276,7 +276,7 @@ export default function applicationLog(
|
||||
});
|
||||
case RESET_APPLICATION_LOG_KEY_SUCCESS:
|
||||
applicationLogs = state.applicationLogsList.applicationLogs.map(
|
||||
applicationLog => {
|
||||
(applicationLog: $TSFixMe) => {
|
||||
if (applicationLog._id === action.payload._id) {
|
||||
applicationLog = action.payload;
|
||||
}
|
||||
@ -319,7 +319,7 @@ export default function applicationLog(
|
||||
});
|
||||
case EDIT_APPLICATION_LOG_SWITCH:
|
||||
applicationLogs = state.applicationLogsList.applicationLogs.map(
|
||||
applicationLog => {
|
||||
(applicationLog: $TSFixMe) => {
|
||||
if (applicationLog._id === action.payload) {
|
||||
if (!applicationLog.editMode) {
|
||||
applicationLog.editMode = true;
|
||||
@ -348,7 +348,7 @@ export default function applicationLog(
|
||||
});
|
||||
case EDIT_APPLICATION_LOG_SUCCESS:
|
||||
applicationLogs = state.applicationLogsList.applicationLogs.map(
|
||||
applicationLog => {
|
||||
(applicationLog: $TSFixMe) => {
|
||||
if (applicationLog._id === action.payload._id) {
|
||||
applicationLog = action.payload;
|
||||
}
|
||||
|
@ -72,9 +72,9 @@ export default function customField(
|
||||
};
|
||||
|
||||
case types.DELETE_CUSTOM_FIELD_SUCCESS: {
|
||||
const fields: $TSFixMe = state.customFields.fields.filter(
|
||||
field => String(field._id) !== String(action.payload._id)
|
||||
);
|
||||
const fields: $TSFixMe = state.customFields.fields.filter((field: $TSFixMe) => {
|
||||
return String(field._id) !== String(action.payload._id);
|
||||
});
|
||||
return {
|
||||
...state,
|
||||
customFields: {
|
||||
@ -150,13 +150,15 @@ export default function customField(
|
||||
};
|
||||
|
||||
case types.UPDATE_CUSTOM_FIELD_SUCCESS: {
|
||||
const fields: $TSFixMe = state.customFields.fields.map(field: $TSFixMe => {
|
||||
if (String(field._id) === String(action.payload._id)) {
|
||||
field = action.payload;
|
||||
}
|
||||
const fields: $TSFixMe = state.customFields.fields.map(
|
||||
(field: $TSFixMe) => {
|
||||
if (String(field._id) === String(action.payload._id)) {
|
||||
field = action.payload;
|
||||
}
|
||||
|
||||
return field;
|
||||
});
|
||||
return field;
|
||||
}
|
||||
);
|
||||
return {
|
||||
...state,
|
||||
customFields: {
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -71,7 +71,7 @@ export default function monitorCustomField(
|
||||
|
||||
case types.DELETE_CUSTOM_FIELD_SUCCESS: {
|
||||
const fields: $TSFixMe = state.monitorCustomFields.fields.filter(
|
||||
field => {
|
||||
(field: $TSFixMe) => {
|
||||
return String(field._id) !== String(action.payload._id);
|
||||
}
|
||||
);
|
||||
|
@ -79,9 +79,11 @@ export default function monitorSla(
|
||||
};
|
||||
|
||||
case types.DELETE_MONITOR_SLA_SUCCESS: {
|
||||
const slas: $TSFixMe = state.monitorSlas.slas.filter(sla => {
|
||||
return String(sla._id) !== String(action.payload._id);
|
||||
});
|
||||
const slas: $TSFixMe = state.monitorSlas.slas.filter(
|
||||
(sla: $TSFixMe) => {
|
||||
return String(sla._id) !== String(action.payload._id);
|
||||
}
|
||||
);
|
||||
return {
|
||||
...state,
|
||||
monitorSlas: {
|
||||
|
@ -706,7 +706,7 @@ export default function statusPage(
|
||||
|
||||
case CREATE_STATUSPAGE_SUCCESS:
|
||||
isExistingStatusPage = state.subProjectStatusPages.find(
|
||||
statusPage => {
|
||||
(statusPage: $TSFixMe) => {
|
||||
return (
|
||||
statusPage._id === action.payload.projectId ||
|
||||
statusPage._id === action.payload.projectId._id
|
||||
@ -1529,7 +1529,7 @@ export default function statusPage(
|
||||
case FETCH_PROJECT_STATUSPAGE_SUCCESS:
|
||||
return Object.assign({}, state, {
|
||||
subProjectStatusPages: state.subProjectStatusPages.map(
|
||||
statusPage => {
|
||||
(statusPage: $TSFixMe) => {
|
||||
return statusPage._id === action.payload.projectId ||
|
||||
statusPage._id === action.payload.projectId._id
|
||||
? {
|
||||
@ -1571,11 +1571,11 @@ export default function statusPage(
|
||||
success: true,
|
||||
error: null,
|
||||
},
|
||||
statusPages: state.statusPages.filter(({ _id }) => {
|
||||
statusPages: state.statusPages.filter(({ _id }: $TSFixMe) => {
|
||||
return _id !== action.payload._id;
|
||||
}),
|
||||
subProjectStatusPages: state.subProjectStatusPages.map(
|
||||
subProjectStatusPage => {
|
||||
(subProjectStatusPage: $TSFixMe) => {
|
||||
subProjectStatusPage.statusPages =
|
||||
subProjectStatusPage.statusPages.filter(
|
||||
({ _id }: $TSFixMe) => {
|
||||
|
@ -113,7 +113,7 @@ export default function resourceCategory(
|
||||
fetchStatusPageCategories: {
|
||||
...state.fetchStatusPageCategories,
|
||||
categories: state.fetchStatusPageCategories.categories.map(
|
||||
category => {
|
||||
(category: $TSFixMe) => {
|
||||
if (
|
||||
String(category._id) ===
|
||||
String(action.payload._id)
|
||||
@ -224,7 +224,7 @@ export default function resourceCategory(
|
||||
...state.fetchStatusPageCategories,
|
||||
categories:
|
||||
state.fetchStatusPageCategories.categories.filter(
|
||||
category => {
|
||||
(category: $TSFixMe) => {
|
||||
return (
|
||||
String(category._id) !==
|
||||
String(action.payload._id)
|
||||
|
@ -159,7 +159,7 @@ export default (state: $TSFixMe = initialState, action: Action): void => {
|
||||
},
|
||||
// teamMembers: action.payload
|
||||
subProjectTeamMembers: state.subProjectTeamMembers.map(
|
||||
subProject => {
|
||||
(subProject: $TSFixMe) => {
|
||||
subProject.teamMembers = action.payload.find(
|
||||
(team: $TSFixMe) => {
|
||||
return team.projectId === subProject._id;
|
||||
@ -213,7 +213,7 @@ export default (state: $TSFixMe = initialState, action: Action): void => {
|
||||
},
|
||||
// teamMembers: action.payload.data,
|
||||
subProjectTeamMembers: state.subProjectTeamMembers.map(
|
||||
subProject => {
|
||||
(subProject: $TSFixMe) => {
|
||||
if (action.payload) {
|
||||
const projectObj: $TSFixMe = action.payload.find(
|
||||
(team: $TSFixMe) => {
|
||||
@ -318,7 +318,7 @@ export default (state: $TSFixMe = initialState, action: Action): void => {
|
||||
},
|
||||
// teamMembers: teamMembers,
|
||||
subProjectTeamMembers: state.subProjectTeamMembers.map(
|
||||
subProject => {
|
||||
(subProject: $TSFixMe) => {
|
||||
subProject.teamMembers = action.payload.find(
|
||||
(team: $TSFixMe) => {
|
||||
return team.projectId === subProject._id;
|
||||
|
@ -4,7 +4,7 @@
|
||||
* @returns a string
|
||||
*/
|
||||
|
||||
const joinNames: Function = (acc: $TSFixMe = [], arr: $TSFixMe): void => {
|
||||
const joinNames: Function = (arr: $TSFixMe): void => {
|
||||
if (!Array.isArray(arr)) {
|
||||
return '';
|
||||
}
|
||||
|
@ -40,9 +40,6 @@ const keyBind: Function = (
|
||||
|
||||
export const navKeyBind: Function = (route: $TSFixMe, path: $TSFixMe): void => {
|
||||
let keys: $TSFixMe = [];
|
||||
const resetKeys: Function = (): void => {
|
||||
return (acc: $TSFixMe = []);
|
||||
};
|
||||
// reasons to use keydown
|
||||
// 1 --> gives the user impression that they can press and hold two keys simultaneously
|
||||
// 2 --> accommodate users that don't like pressing and holding two keys simultaneously (which is the actual behaviour, (^-^))
|
||||
@ -54,7 +51,7 @@ export const navKeyBind: Function = (route: $TSFixMe, path: $TSFixMe): void => {
|
||||
export const cleanBind: Function = (route: $TSFixMe, path: $TSFixMe): void => {
|
||||
let keys: $TSFixMe = [];
|
||||
const resetKeys: Function = (): void => {
|
||||
return (acc: $TSFixMe = []);
|
||||
return [];
|
||||
};
|
||||
window.removeEventListener('keydown', (e: $TSFixMe) => {
|
||||
return keyBind(e, route, path, keys, resetKeys);
|
||||
|
@ -205,7 +205,7 @@ export default {
|
||||
},
|
||||
});
|
||||
|
||||
const incidentIds: $TSFixMe = incidents.map(incident: $TSFixMe => incident._id);
|
||||
const incidentIds: $TSFixMe = incidents.map((incident: $TSFixMe) => incident._id);
|
||||
|
||||
if (incidentIds && incidentIds.length) {
|
||||
log = await MonitorLogService.updateOneBy(
|
||||
|
@ -41,7 +41,7 @@ const _this: $TSFixMe = {
|
||||
});
|
||||
},
|
||||
|
||||
get: (url: URL, withBaseUrl = false) => {
|
||||
get: (url: URL, withBaseUrl: $TSFixMe = false) => {
|
||||
const headers: $TSFixMe = this.getHeaders();
|
||||
return new Promise((resolve: Function, reject: Function) => {
|
||||
axios({
|
||||
|
@ -58,7 +58,7 @@ class HTTPTestServerResponse {
|
||||
this._htmlBody = v;
|
||||
}
|
||||
|
||||
toJSON(): JSONObject {
|
||||
public toJSON(): JSONObject {
|
||||
return {
|
||||
statusCode: this.statusCode.toNumber(),
|
||||
responseType: {
|
||||
|
@ -28,7 +28,7 @@ export default {
|
||||
return promise;
|
||||
},
|
||||
|
||||
decrypt: (encText: $TSFixMe, iv = EncryptionKeys.iv) => {
|
||||
decrypt: (encText: $TSFixMe, iv : $TSFixMe = EncryptionKeys.iv) => {
|
||||
const promise: Promise = new Promise(
|
||||
(resolve: Function, reject: Function): $TSFixMe => {
|
||||
try {
|
||||
|
@ -4,7 +4,7 @@
|
||||
* @returns { string } a string of random characters
|
||||
*/
|
||||
|
||||
export default (num = 15): void => {
|
||||
export default (num: $TSFixMe = 15): void => {
|
||||
const input: $TSFixMe =
|
||||
'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
|
||||
let output: $TSFixMe = '';
|
||||
|
@ -272,7 +272,7 @@ checkParams(questions).then((values: $TSFixMe) => {
|
||||
return `${monitor.componentId.name} / ${monitor.name} (${monitor._id})`;
|
||||
});
|
||||
|
||||
prompt(question).then(({ monitorId }) => {
|
||||
prompt(question).then(({ monitorId }: $TSFixMe) => {
|
||||
resolve(
|
||||
monitorId
|
||||
.replace(/\/|\(|\)$/gi, '')
|
||||
|
@ -124,9 +124,16 @@ const ping: Function = (
|
||||
.map((partition: $TSFixMe) => {
|
||||
return partition.used;
|
||||
})
|
||||
.reduce((used, partitionUsed) => {
|
||||
return used + partitionUsed;
|
||||
})
|
||||
.reduce(
|
||||
(
|
||||
used: $TSFixMe,
|
||||
partitionUsed: $TSFixMe
|
||||
) => {
|
||||
return (
|
||||
used + partitionUsed
|
||||
);
|
||||
}
|
||||
)
|
||||
: storage.used,
|
||||
totalStorage:
|
||||
storage && storage.length > 0
|
||||
@ -138,7 +145,7 @@ const ping: Function = (
|
||||
.map((partition: $TSFixMe) => {
|
||||
return partition.use;
|
||||
})
|
||||
.reduce((use, partitionUse) => {
|
||||
.reduce((use: $TSFixMe, partitionUse: $TSFixMe) => {
|
||||
return use + partitionUse;
|
||||
})
|
||||
: storage.use,
|
||||
@ -189,7 +196,7 @@ export default function (
|
||||
monitorId: $TSFixMe
|
||||
): void {
|
||||
let pingServer: $TSFixMe,
|
||||
projectId = config,
|
||||
projectId: $TSFixMe = config,
|
||||
interval: $TSFixMe,
|
||||
timeout: $TSFixMe,
|
||||
simulate: $TSFixMe,
|
||||
@ -212,7 +219,7 @@ export default function (
|
||||
* @param {string} id - The monitor id of the server monitor.
|
||||
* @return {(Object | number)} The ping server cron job or the error code.
|
||||
*/
|
||||
start: (id = monitorId) => {
|
||||
start: (id: $TSFixMe = monitorId) => {
|
||||
const url: string = `monitor/${projectId}/monitor/${
|
||||
id && typeof id === 'string' ? `${id}/` : ''
|
||||
}?type=server-monitor`;
|
||||
|
@ -78,7 +78,7 @@ const post: Function = (
|
||||
data: $TSFixMe,
|
||||
key: $TSFixMe,
|
||||
success: $TSFixMe,
|
||||
error = defaultErrorHandler
|
||||
error: $TSFixMe = defaultErrorHandler
|
||||
): void => {
|
||||
headers['apiKey'] = key;
|
||||
|
||||
|
@ -21,7 +21,7 @@ const badProjectId: string = 'badProjectId',
|
||||
badApiKey: $TSFixMe = 'badApiKey';
|
||||
const invalidProjectId: string = utils.generateRandomString();
|
||||
const timeout: $TSFixMe = 5000,
|
||||
monitor = {
|
||||
monitor: $TSFixMe = {
|
||||
name: 'New Monitor',
|
||||
type: 'server-monitor',
|
||||
data: {},
|
||||
|
@ -166,7 +166,7 @@ class OneUptimeListener {
|
||||
(res: $TSFixMe) => {
|
||||
obj.status_code = res.status;
|
||||
},
|
||||
err => {
|
||||
(err: $TSFixMe) => {
|
||||
obj.status_code = err.status;
|
||||
}
|
||||
);
|
||||
|
@ -9,7 +9,7 @@ class MongooseListener {
|
||||
this.end = end;
|
||||
}
|
||||
|
||||
wrapAsync(orig, name) {
|
||||
public wrapAsync(orig: $TSFixMe, name: $TSFixMe) {
|
||||
return async function (): void {
|
||||
const uuid: $TSFixMe = uuidv4();
|
||||
|
||||
|
@ -73,13 +73,13 @@ class PerformanceTracker {
|
||||
process.on('unhandledRejection', this._sendDataOnExit.bind(this));
|
||||
process.on('uncaughtException', this._sendDataOnExit.bind(this));
|
||||
}
|
||||
async _sendDataOnExit(): void {
|
||||
private async _sendDataOnExit(): void {
|
||||
await this.store.processDataOnExit();
|
||||
}
|
||||
private _setUpOutgoingListener(): void {
|
||||
return new OutgoingListener(this.start, this.end, this.store);
|
||||
}
|
||||
setUpDataBaseListener(): void {
|
||||
public setUpDataBaseListener(): void {
|
||||
const load: $TSFixMe = Module._load;
|
||||
|
||||
Module._load = function (request: $TSFixMe): void {
|
||||
|
@ -159,7 +159,7 @@ private _getUserDeviceDetails(): void {
|
||||
}
|
||||
private _readFileFromSource(fileName: $TSFixMe): void {
|
||||
return new Promise((resolve: $TSFixMe) => {
|
||||
readFile(fileName, (err: $TSFixMe, data: $TSFixMe){
|
||||
readFile(fileName: $TSFixMe, (err: $TSFixMe, data: $TSFixMe)=> {
|
||||
const content: $TSFixMe = err ? null : data.toString();
|
||||
|
||||
CONTENT_CACHE.set(fileName, content);
|
||||
|
@ -11,7 +11,7 @@ class PerfTimer {
|
||||
this.appId = appId;
|
||||
this.appKey = appKey;
|
||||
this.dataStore = new DataStore(this.apiUrl, this.appId, this.appKey);
|
||||
this.obs = new PerformanceObserver((list: $TSFixMe) {
|
||||
this.obs = new PerformanceObserver((list: $TSFixMe) =>{
|
||||
const entry: $TSFixMe = list.getEntries()[0];
|
||||
const id: $TSFixMe = entry.name.slice(entry.name.indexOf('-') + 1);
|
||||
const originalValue: $TSFixMe = this.dataStore.getValue(id);
|
||||
|
@ -28,7 +28,7 @@ describe('Tracker Timeline', function (): void {
|
||||
});
|
||||
};
|
||||
this.timeout(timeout + 1000);
|
||||
let projectId: ObjectID, token: $TSFixMe, componentId;
|
||||
let projectId: ObjectID, token: $TSFixMe, componentId: $TSFixMe;
|
||||
// create a new user
|
||||
const component: $TSFixMe = { name: 'Our Component' };
|
||||
|
||||
|
@ -292,10 +292,7 @@ export default class MailService {
|
||||
mail.body = await this.compileEmailBody(mail.templateType, mail.vars);
|
||||
mail.subject = this.compileSubject(mail.subject, mail.vars);
|
||||
|
||||
try {
|
||||
await this.transportMail(mail, mailServer);
|
||||
} catch (error) {
|
||||
throw error;
|
||||
}
|
||||
await this.transportMail(mail, mailServer);
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -150,8 +150,8 @@ const run: Function = async (
|
||||
});
|
||||
|
||||
let totalRuntime: $TSFixMe = 0,
|
||||
statementTimeExceeded = false,
|
||||
scriptTimeExceeded = false;
|
||||
statementTimeExceeded: $TSFixMe = false,
|
||||
scriptTimeExceeded: $TSFixMe = false;
|
||||
|
||||
const checker: $TSFixMe = setInterval(
|
||||
() => {
|
||||
|
@ -1463,7 +1463,7 @@ export const getAnnouncementsFailure: Function = (data: $TSFixMe): void => {
|
||||
export function getAnnouncements(
|
||||
projectId: ObjectID,
|
||||
statusPageId: $TSFixMe,
|
||||
skip: number = 0
|
||||
skip: number = 0,
|
||||
limit: PositiveNumber
|
||||
) {
|
||||
return function (dispatch: Dispatch): void {
|
||||
|
Loading…
Reference in New Issue
Block a user