This commit is contained in:
Nawaz Dhandala 2022-04-15 16:22:42 +01:00
parent 48d25247a0
commit b750e514ad
No known key found for this signature in database
GPG Key ID: 96C5DCA24769DBCA
57 changed files with 218 additions and 138 deletions

View File

@ -12,7 +12,10 @@ const initialState: $TSFixMe = {
success: false,
};
export default function register(state: $TSFixMe = initialState, action: Action): void {
export default function register(
state: $TSFixMe = initialState,
action: Action
): void {
switch (action.type) {
case types.CHANGEPASSWORD_REQUEST:
return Object.assign({}, state, {

View File

@ -52,7 +52,10 @@ const initialState: $TSFixMe = {
loginMethod: 'standard',
};
export default function register(state: $TSFixMe = initialState, action: Action): void {
export default function register(
state: $TSFixMe = initialState,
action: Action
): void {
switch (action.type) {
case CHANGE_LOGIN:
return Object.assign({}, state, {

View File

@ -47,7 +47,10 @@ const initialState: $TSFixMe = {
email: null,
};
export default function register(state: $TSFixMe = initialState, action: Action): void {
export default function register(
state: $TSFixMe = initialState,
action: Action
): void {
let incCount: $TSFixMe, decCount: $TSFixMe, stage: $TSFixMe;
switch (action.type) {
case SIGNUP_REQUEST:

View File

@ -13,7 +13,10 @@ const initialState: $TSFixMe = {
success: false,
};
export default function register(state: $TSFixMe = initialState, action: Action): void {
export default function register(
state: $TSFixMe = initialState,
action: Action
): void {
switch (action.type) {
case RESENDTOKEN_REQUEST:
return Object.assign({}, state, {

View File

@ -17,7 +17,10 @@ const initialState: $TSFixMe = {
success: false,
};
export default function register(state: $TSFixMe = initialState, action: Action): void {
export default function register(
state: $TSFixMe = initialState,
action: Action
): void {
switch (action.type) {
case PASSWORDRESET_REQUEST:
return Object.assign({}, state, {

View File

@ -94,7 +94,7 @@ export default (state: $TSFixMe = initialState, action: Action): void => {
notifications: {
...state.notifications,
notifications: state.notifications.notifications.map(
notification => {
(notification: $TSFixMe) => {
if (
notification._id ===
action.payload.notificationId._id

View File

@ -29,7 +29,10 @@ const initialState: $TSFixMe = {
},
};
export default function probes(state: $TSFixMe = initialState, action: Action): void {
export default function probes(
state: $TSFixMe = initialState,
action: Action
): void {
switch (action.type) {
case types.PROBE_SUCCESS:
return Object.assign({}, state, {

View File

@ -1,8 +1,8 @@
import moment from 'moment';
const MonitorService: $TSFixMe = require('../Services/monitorService'),
MonitorLogService = require('../Services/monitorLogService'),
MonitorStatusService = require('../Services/monitorStatusService'),
ProbeService = require('../Services/probeService');
MonitorLogService: $TSFixMe = require('../Services/monitorLogService'),
MonitorStatusService: $TSFixMe = require('../Services/monitorStatusService'),
ProbeService: $TSFixMe = require('../Services/probeService');
export default {
checkAllServerMonitors: async () => {

View File

@ -37,11 +37,11 @@ export default class URL {
}
}
isHttps(): boolean {
public isHttps(): boolean {
return this.protocol === Protocol.HTTPS;
}
toString(): string {
public toString(): string {
return `${this.protocol}${this.hostname}${this.route}`;
}

View File

@ -48,7 +48,7 @@ export default class Domain {
this.domain = domain;
}
toString(): string {
public toString(): string {
return this.domain;
}
}

View File

@ -29,7 +29,7 @@ export default class EmailWithName {
this.name = name;
}
toString(): string {
public toString(): string {
return `"${this.name}" <${this.email}>`;
}
}

View File

@ -11,7 +11,7 @@ export default class HTML {
this.html = html;
}
toString(): string {
public toString(): string {
return this.html;
}
}

View File

@ -22,11 +22,11 @@ export interface JSONObject {
export interface JSONArray extends Array<JSONObject> {}
export class JSONFunctions {
toCompressedString(val: JSONValue): string {
public toCompressedString(val: JSONValue): string {
return JSON.stringify(val, null, 2);
}
toString(val: JSONValue): string {
public toString(val: JSONValue): string {
return JSON.stringify(val);
}
}

View File

@ -19,11 +19,11 @@ export default class Name {
this.name = name;
}
getFirstName(): string {
public getFirstName(): string {
return this.name.split(' ')[0] || '';
}
getLastName(): string {
public getLastName(): string {
if (this.name.split(' ').length > 1) {
return this.name.split(' ')[this.name.split(' ').length - 1] || '';
} else {
@ -31,7 +31,7 @@ export default class Name {
}
}
getMiddleName(): string {
public getMiddleName(): string {
if (this.name.split(' ').length > 2) {
return this.name.split(' ')[1] || '';
} else {
@ -39,7 +39,7 @@ export default class Name {
}
}
toString(): string {
public toString(): string {
return this.name;
}
}

View File

@ -20,11 +20,11 @@ export default class Port {
}
}
toString(): string {
public toString(): string {
return this.port.toString();
}
toNumber(): number {
public toNumber(): number {
return this.port.toNumber();
}
}

View File

@ -20,7 +20,7 @@ export default class Service {
return base(tableName).destroy(id);
}
logUser({
public logUser({
name,
email,
phone,
@ -44,7 +44,7 @@ export default class Service {
});
}
logLeads({
public logLeads({
name,
country,
email,
@ -74,7 +74,7 @@ export default class Service {
});
}
deleteUser(airtableId: $TSFixMe): void {
public deleteUser(airtableId: $TSFixMe): void {
if (!base) {
return;
}
@ -86,7 +86,7 @@ export default class Service {
//Params:
//Param 1: data: Feedback data (message, name, email, project, page).
//Returns: promise
logFeedback({ message, name, email, project, page }: $TSFixMe): void {
public logFeedback({ message, name, email, project, page }: $TSFixMe): void {
if (!base) {
return;
}
@ -100,7 +100,7 @@ export default class Service {
});
}
deleteFeedback(airtableId: $TSFixMe): void {
public deleteFeedback(airtableId: $TSFixMe): void {
if (!base) {
return;
}
@ -140,7 +140,7 @@ export default class Service {
}
}
logProjectDeletionFeedback({
public logProjectDeletionFeedback({
reason,
project,
name,

View File

@ -51,8 +51,8 @@ class DatabaseService<ModelType> {
public memberItemProps: ItemProps;
public memberListProps: ListProps;
public model: Model<ModelType>;
publicItemProps: ItemProps;
publicListProps: ListProps;
public ItemProps: ItemProps;
public ListProps: ListProps;
public requiredFields: RequiredFields;
public uniqueFields: UniqueFields;
public encryptedFields: EncryptedFields;

View File

@ -217,7 +217,7 @@ export default class Service {
}
// sort total error events by latest occurence date
totalErrorEvents.sort((eventA, eventB) => {
totalErrorEvents.sort((eventA: $TSFixMe, eventB: $TSFixMe) => {
return moment(eventB.latestOccurennce).isAfter(
eventA.latestOccurennce
);

View File

@ -163,7 +163,7 @@ export default class Service {
let incident: $TSFixMe = new IncidentModel();
let parentCount: $TSFixMe = 0,
deletedParentCount = 0;
deletedParentCount: $TSFixMe = 0;
if (project && project.parentProjectId) {
const [pCount, dpCount]: $TSFixMe = await Promise.all([
this.countBy({

View File

@ -1073,8 +1073,8 @@ export default class Service {
const incidentArray: $TSFixMe = [];
for (const filter of updatedFilters) {
const filterCriteria: $TSFixMe = filter.filterCriteria,
filterCondition = filter.filterCondition,
filterText = filter.filterText;
filterCondition: $TSFixMe = filter.filterCondition,
filterText: $TSFixMe = filter.filterText;
if (
filterCriteria &&
@ -1625,8 +1625,8 @@ export default class Service {
const incidentArray: $TSFixMe = [];
for (const filter of updatedFilters) {
const filterCriteria: $TSFixMe = filter.filterCriteria,
filterCondition = filter.filterCondition,
filterText = filter.filterText;
filterCondition: $TSFixMe = filter.filterCondition,
filterText: $TSFixMe = filter.filterText;
if (
filterCriteria &&
@ -1901,8 +1901,8 @@ 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 &&

View File

@ -751,9 +751,8 @@ export default class Service {
});
}
/**
* @description Create Ended note for all schedule events
async */ createScheduledEventEndedNote(): void {
public async createScheduledEventEndedNote(): void {
const currentTime: $TSFixMe = moment();
//fetch events that have ended

View File

@ -141,7 +141,7 @@ export default class Service {
// grab the email from xml response
// assuming there's only one email in the xml response
// or the same email x times in the response
getEmail(xml: $TSFixMe): void {
public getEmail(xml: $TSFixMe): void {
const stringifiedXml: $TSFixMe = String(xml);
const regex: $TSFixMe = // eslint-disable-next-line no-control-regex

View File

@ -312,21 +312,21 @@ export default class StripeService {
);
if (amountRechargedStripe) {
const projectId: $TSFixMe = paymentIntent.metadata.projectId,
minimumBalance =
minimumBalance : $TSFixMe =
paymentIntent.metadata.minimumBalance &&
Number(paymentIntent.metadata.minimumBalance),
rechargeToBalance =
rechargeToBalance: $TSFixMe =
paymentIntent.metadata.rechargeToBalance &&
Number(paymentIntent.metadata.rechargeToBalance),
billingUS =
billingUS: $TSFixMe =
paymentIntent.metadata.billingUS &&
JSON.parse(paymentIntent.metadata.billingUS),
billingNonUSCountries =
billingNonUSCountries: $TSFixMe =
paymentIntent.metadata.billingNonUSCountries &&
JSON.parse(
paymentIntent.metadata.billingNonUSCountries
),
billingRiskCountries =
billingRiskCountries: $TSFixMe =
paymentIntent.metadata.billingRiskCountries &&
JSON.parse(paymentIntent.metadata.billingRiskCountries);

View File

@ -3,13 +3,13 @@ import { getErrorMessageFromResponse } from '../../utils/error';
import { Dispatch } from 'redux';
import ErrorPayload from 'CommonUI/src/payload-types/error';
class BaseAction {
actionKeys: $TSFixMe;
actionType: $TSFixMe;
apiName: $TSFixMe;
constantKeys: $TSFixMe;
friendlyName: $TSFixMe;
isRequestAllowed: $TSFixMe;
isResourceInProject: $TSFixMe;
private actionKeys: $TSFixMe;
private actionType: $TSFixMe;
private apiName: $TSFixMe;
private constantKeys: $TSFixMe;
private friendlyName: $TSFixMe;
private isRequestAllowed: $TSFixMe;
private isResourceInProject: $TSFixMe;
public constructor({
friendlyName,
apiPath,
@ -43,7 +43,7 @@ class BaseAction {
};
}
getConstants(): void {
public getConstants(): void {
const friendlyName: $TSFixMe = this.friendlyName
.replace(' ', '_')
.toUpperCase();
@ -88,7 +88,7 @@ class BaseAction {
return constants;
}
getActions(): void {
public getActions(): void {
const constants: $TSFixMe = this.getConstants();
const actions: $TSFixMe = {};

View File

@ -78,7 +78,10 @@ const initialState: $TSFixMe = {
},
};
export default function card(state: $TSFixMe = initialState, action: Action): void {
export default function card(
state: $TSFixMe = initialState,
action: Action
): void {
switch (action.type) {
case types.GET_CALL_ROUTING_NUMBERS_REQUEST:
return Object.assign({}, state, {

View File

@ -30,7 +30,10 @@ const initialState: $TSFixMe = {
},
};
export default function card(state: $TSFixMe = initialState, action: Action): void {
export default function card(
state: $TSFixMe = initialState,
action: Action
): void {
switch (action.type) {
case types.ADD_CARD_REQUEST:
return Object.assign({}, state, {

View File

@ -12,7 +12,10 @@ const initialState: $TSFixMe = {
success: false,
};
export default function register(state: $TSFixMe = initialState, action: Action): void {
export default function register(
state: $TSFixMe = initialState,
action: Action
): void {
switch (action.type) {
case types.CHANGEPASSWORD_REQUEST:
return Object.assign({}, state, {

View File

@ -9,7 +9,10 @@ const initialState: $TSFixMe = {
},
};
export default function dateTime(state: $TSFixMe = initialState, action: Action): void {
export default function dateTime(
state: $TSFixMe = initialState,
action: Action
): void {
switch (action.type) {
case 'SET_START_DATE':
return Object.assign({}, state, {

View File

@ -35,7 +35,10 @@ const initialState: $TSFixMe = {
showEmailSmtpConfiguration: false,
};
export default function incident(state: $TSFixMe = initialState, action: Action): void {
export default function incident(
state: $TSFixMe = initialState,
action: Action
): void {
switch (action.type) {
case types.EMAIL_TEMPLATES_SUCCESS:
return Object.assign({}, state, {

View File

@ -12,7 +12,10 @@ const initialState: $TSFixMe = {
oncallDuty: [],
};
export default function groups(state: $TSFixMe = initialState, action: Action): void {
export default function groups(
state: $TSFixMe = initialState,
action: Action
): void {
let updatedGroup: $TSFixMe;
switch (action.type) {
case types.GET_GROUPS_REQUEST:

View File

@ -84,7 +84,10 @@ const initialState: $TSFixMe = {
activeIncident: null,
};
export default function incident(state: $TSFixMe = initialState, action: Action): void {
export default function incident(
state: $TSFixMe = initialState,
action: Action
): void {
let incident: $TSFixMe,
incidents: $TSFixMe,
unresolvedincidents: $TSFixMe,

View File

@ -71,7 +71,9 @@ export default function monitorCustomField(
case types.DELETE_CUSTOM_FIELD_SUCCESS: {
const fields: $TSFixMe = state.monitorCustomFields.fields.filter(
field => String(field._id) !== String(action.payload._id)
field => {
return String(field._id) !== String(action.payload._id);
}
);
return {
...state,
@ -148,13 +150,15 @@ export default function monitorCustomField(
};
case types.UPDATE_CUSTOM_FIELD_SUCCESS: {
const fields: $TSFixMe = state.monitorCustomFields.fields.map(field: $TSFixMe => {
if (String(field._id) === String(action.payload._id)) {
field = action.payload;
}
const fields: $TSFixMe = state.monitorCustomFields.fields.map(
(field: $TSFixMe) => {
if (String(field._id) === String(action.payload._id)) {
field = action.payload;
}
return field;
});
return field;
}
);
return {
...state,
monitorCustomFields: {

View File

@ -28,7 +28,10 @@ const initialState: $TSFixMe = {
page: 1,
};
export default function monitorSla(state: $TSFixMe = initialState, action: Action): void {
export default function monitorSla(
state: $TSFixMe = initialState,
action: Action
): void {
switch (action.type) {
case types.CREATE_MONITOR_SLA_REQUEST:
return {
@ -76,9 +79,9 @@ export default function monitorSla(state: $TSFixMe = initialState, action: Actio
};
case types.DELETE_MONITOR_SLA_SUCCESS: {
const slas: $TSFixMe = state.monitorSlas.slas.filter(
sla => String(sla._id) !== String(action.payload._id)
);
const slas: $TSFixMe = state.monitorSlas.slas.filter(sla => {
return String(sla._id) !== String(action.payload._id);
});
return {
...state,
monitorSlas: {
@ -184,20 +187,22 @@ export default function monitorSla(state: $TSFixMe = initialState, action: Actio
};
case types.UPDATE_MONITOR_SLA_SUCCESS: {
const slas: $TSFixMe = state.monitorSlas.slas.map(sla: $TSFixMe => {
if (
action.payload.isDefault &&
String(sla._id) !== String(action.payload._id)
) {
sla.isDefault = false;
}
const slas: $TSFixMe = state.monitorSlas.slas.map(
(sla: $TSFixMe) => {
if (
action.payload.isDefault &&
String(sla._id) !== String(action.payload._id)
) {
sla.isDefault = false;
}
if (String(sla._id) === String(action.payload._id)) {
sla = action.payload;
}
if (String(sla._id) === String(action.payload._id)) {
sla = action.payload;
}
return sla;
});
return sla;
}
);
return {
...state,
monitorSlas: {

View File

@ -97,7 +97,7 @@ export default (state: $TSFixMe = initialState, action: Action): void => {
notifications: {
...state.notifications,
notifications: state.notifications.notifications.map(
notification => {
(notification: $TSFixMe) => {
if (
notification._id ===
action.payload.notificationId
@ -121,7 +121,7 @@ export default (state: $TSFixMe = initialState, action: Action): void => {
notifications: {
...state.notifications,
notifications: state.notifications.notifications.map(
notification => {
(notification: $TSFixMe) => {
if (
notification._id ===
action.payload.notificationId
@ -145,7 +145,7 @@ export default (state: $TSFixMe = initialState, action: Action): void => {
notifications: {
...state.notifications,
notifications: state.notifications.notifications.map(
notification => {
(notification: $TSFixMe) => {
return {
...notification,
read: notification.read.concat([
@ -162,7 +162,7 @@ export default (state: $TSFixMe = initialState, action: Action): void => {
notifications: {
...state.notifications,
notifications: state.notifications.notifications.filter(
notification => {
(notification: $TSFixMe) => {
return notification.projectId !== action.payload;
}
),

View File

@ -14,7 +14,10 @@ const initialState: $TSFixMe = {
},
};
export default function probes(state: $TSFixMe = initialState, action: Action): void {
export default function probes(
state: $TSFixMe = initialState,
action: Action
): void {
switch (action.type) {
case types.PROBE_SUCCESS:
return Object.assign({}, state, {

View File

@ -128,7 +128,10 @@ const initialState: $TSFixMe = {
},
};
export default function project(state: $TSFixMe = initialState, action: Action): void {
export default function project(
state: $TSFixMe = initialState,
action: Action
): void {
let projects: $TSFixMe, newProjects: $TSFixMe;
switch (action.type) {
case types.CHANGE_DELETE_MODAL:

View File

@ -31,7 +31,10 @@ const initialState: $TSFixMe = {
},
};
export default function incidents(state: $TSFixMe = initialState, action: Action): void {
export default function incidents(
state: $TSFixMe = initialState,
action: Action
): void {
switch (action.type) {
case types.GET_ACTIVE_MEMBERS_REQUEST:
return Object.assign({}, state, {

View File

@ -193,7 +193,7 @@ export default function resourceCategory(
...state.resourceCategoryListForNewResource,
resourceCategories:
state.resourceCategoryListForNewResource.resourceCategories.filter(
resourceCategory => {
(resourceCategory: $TSFixMe) => {
if (resourceCategory._id === action.payload) {
return false;
} else {
@ -206,7 +206,7 @@ export default function resourceCategory(
...state.resourceCategoryList,
resourceCategories:
state.resourceCategoryList.resourceCategories.filter(
resourceCategory => {
(resourceCategory: $TSFixMe) => {
if (resourceCategory._id === action.payload) {
return false;
} else {

View File

@ -125,7 +125,10 @@ const initialState: $TSFixMe = {
},
};
export default function schedule(state: $TSFixMe = initialState, action: Action): void {
export default function schedule(
state: $TSFixMe = initialState,
action: Action
): void {
let data: $TSFixMe, index: $TSFixMe, isExistingSchedule: $TSFixMe;
switch (action.type) {
case SCHEDULE_FETCH_SUCCESS:

View File

@ -17,7 +17,10 @@ const initialState: $TSFixMe = {
searchFieldVisible: false,
};
export default function search(state: $TSFixMe = initialState, action: Action): void {
export default function search(
state: $TSFixMe = initialState,
action: Action
): void {
switch (action.type) {
case SHOW_SEARCH_BAR:
return Object.assign({}, state, {

View File

@ -43,7 +43,10 @@ const initialState: $TSFixMe = {
activeApplicationSecurity: '',
};
export default function security(state: $TSFixMe = initialState, action: Action): void {
export default function security(
state: $TSFixMe = initialState,
action: Action
): void {
switch (action.type) {
case types.ADD_CONTAINER_SECURITY_REQUEST:
return {
@ -97,7 +100,7 @@ export default function security(state: $TSFixMe = initialState, action: Action)
const securities: $TSFixMe =
state.containerSecurities.securities.length > 0
? state.containerSecurities.securities.map(
(containerSecurity : $TSFixMe) =>{
(containerSecurity: $TSFixMe) => {
if (
String(containerSecurity._id) ===
String(action.payload._id)
@ -192,7 +195,7 @@ export default function security(state: $TSFixMe = initialState, action: Action)
// update the list of container securities
const securities: $TSFixMe =
state.containerSecurities.securities.filter(
(containerSecurity : $TSFixMe) =>{
(containerSecurity: $TSFixMe) => {
return (
String(containerSecurity._id) !==
String(action.payload._id)
@ -410,7 +413,7 @@ export default function security(state: $TSFixMe = initialState, action: Action)
const securities: $TSFixMe =
state.applicationSecurities.securities.length > 0
? state.applicationSecurities.securities.map(
(applicationSecurity : $TSFixMe) =>{
(applicationSecurity: $TSFixMe) => {
if (
String(applicationSecurity._id) ===
String(action.payload._id)
@ -505,7 +508,7 @@ export default function security(state: $TSFixMe = initialState, action: Action)
// update the list of application securities
const securities: $TSFixMe =
state.applicationSecurities.securities.filter(
(applicationSecurity : $TSFixMe) =>{
(applicationSecurity: $TSFixMe) => {
return (
String(applicationSecurity._id) !==
String(action.payload._id)

View File

@ -35,7 +35,10 @@ const initialState: $TSFixMe = {
showSmsSmtpConfiguration: false,
};
export default function incident(state: $TSFixMe = initialState, action: Action): void {
export default function incident(
state: $TSFixMe = initialState,
action: Action
): void {
switch (action.type) {
case types.SMS_TEMPLATES_SUCCESS:
return Object.assign({}, state, {

View File

@ -42,7 +42,10 @@ const initialState: $TSFixMe = {
activeSubProject: null,
};
export default function subProject(state: $TSFixMe = initialState, action: Action): void {
export default function subProject(
state: $TSFixMe = initialState,
action: Action
): void {
let subProjects: $TSFixMe, index: $TSFixMe;
switch (action.type) {
case types.SUBPROJECTS_SUCCESS:

View File

@ -40,7 +40,10 @@ const initialState: $TSFixMe = {
},
};
export default function subscriber(state: $TSFixMe = initialState, action: Action): void {
export default function subscriber(
state: $TSFixMe = initialState,
action: Action
): void {
switch (action.type) {
case types.CREATE_SUBSCRIBER_RESET:
return Object.assign({}, state, {
@ -127,7 +130,7 @@ export default function subscriber(state: $TSFixMe = initialState, action: Actio
subscribers: {
...state.subscribers,
subscribers: state.subscribers.subscribers.filter(
subscriber => {
(subscriber: $TSFixMe) => {
return subscriber !== action.payload._id;
}
),

View File

@ -4,7 +4,7 @@
* @returns a string
*/
const joinNames: Function = (acc: $TSFixMe = []): void => {
const joinNames: Function = (acc: $TSFixMe = [], arr: $TSFixMe): void => {
if (!Array.isArray(arr)) {
return '';
}

View File

@ -7,8 +7,8 @@
function paginate(items: $TSFixMe, page = 1, limit = 10): void {
const offset: Function = (page - 1) * limit,
paginatedItems = items.slice(offset).slice(0, limit),
total_pages = Math.ceil(items.length / limit);
paginatedItems: $TSFixMe = items.slice(offset).slice(0, limit),
total_pages: $TSFixMe = Math.ceil(items.length / limit);
return {
pre_page: page - 1 ? page - 1 : null,
next_page: total_pages > page ? page + 1 : null,

View File

@ -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

View File

@ -88,7 +88,7 @@ const checkParams: Function = (params: $TSFixMe): void => {
return new Promise((resolve: $TSFixMe) => {
resolve(
params.reduce((promiseChain, param) => {
params.reduce((promiseChain: $TSFixMe, param: $TSFixMe) => {
return promiseChain.then(() => {
return getParamValue(params, param.name).then(
(value: $TSFixMe) => {

View File

@ -51,7 +51,7 @@ const get: Function = (
url: URL,
key: $TSFixMe,
success: $TSFixMe,
error = defaultErrorHandler
error: $TSFixMe = defaultErrorHandler
): void => {
headers['apiKey'] = key;

View File

@ -16,9 +16,9 @@ import serverMonitor from '../lib/api';
const user: $TSFixMe = require('./test-utils').user;
user.email = utils.generateRandomBusinessEmail();
let token, projectId: ObjectID, apiKey: string, monitorId: $TSFixMe;
let token: $TSFixMe, projectId: ObjectID, apiKey: string, monitorId: $TSFixMe;
const badProjectId: string = 'badProjectId',
badApiKey = 'badApiKey';
badApiKey: $TSFixMe = 'badApiKey';
const invalidProjectId: string = utils.generateRandomString();
const timeout: $TSFixMe = 5000,
monitor = {

View File

@ -12,7 +12,11 @@ class OneUptimeListener {
options: $TSFixMe;
timelineObj: $TSFixMe;
utilObj: $TSFixMe;
public constructor(eventId: $TSFixMe, isWindow: $TSFixMe, options: $TSFixMe) {
public constructor(
eventId: $TSFixMe,
isWindow: $TSFixMe,
options: $TSFixMe
) {
this.options = options;
this.isWindow = isWindow;
this.timelineObj = new OneUptimeTimelineManager(options);
@ -36,11 +40,11 @@ class OneUptimeListener {
this._setUpFetchListener();
this._setUpXhrListener();
}
public getTimeline(): void {
public getTimeline(): void {
// this always get the current state of the timeline array
return this.timelineObj.getTimeline();
}
public clearTimeline(eventId: $TSFixMe): void {
public clearTimeline(eventId: $TSFixMe): void {
// set a new eventId
this.currentEventId = eventId;
// this will reset the state of the timeline array
@ -101,7 +105,7 @@ public clearTimeline(eventId: $TSFixMe): void {
}
// not logging cus of timeout
public clearTimeout(this.keypressTimeout);
clearTimeout(this.keypressTimeout);
this.keypressTimeout = setTimeout(() => {
this.keypressTimeout = undefined;
@ -276,7 +280,7 @@ public clearTimeline(eventId: $TSFixMe): void {
// add timeline to the stack
this.timelineObj.addToTimeline(timelineObj);
}
public logErrorEvent(content: $TSFixMe, category = 'exception'): void {
public logErrorEvent(content: $TSFixMe, category = 'exception'): void {
const timelineObj: $TSFixMe = {
category,
data: {
@ -288,7 +292,7 @@ public logErrorEvent(content: $TSFixMe, category = 'exception'): void {
// add timeline to the stack
this.timelineObj.addToTimeline(timelineObj);
}
public logCustomTimelineEvent(timelineObj: $TSFixMe): void {
public logCustomTimelineEvent(timelineObj: $TSFixMe): void {
timelineObj.eventId = this.currentEventId;
// add timeline to the stack

View File

@ -11,12 +11,12 @@ class HrTimer {
this.dataStore = new DataStore(this.apiUrl, this.appId, this.appKey);
}
start = (id: $TSFixMe, log: $TSFixMe): void => {
public start(id: $TSFixMe, log: $TSFixMe): void {
this.dataStore.setValue(id, log);
return process.hrtime();
};
}
end = (id: $TSFixMe, startHrTime: $TSFixMe): void => {
public end(id: $TSFixMe, startHrTime: $TSFixMe): void {
let elapsedHrTime: $TSFixMe = process.hrtime(startHrTime);
elapsedHrTime = elapsedHrTime[0] * 1000 + elapsedHrTime[1] / 1e6;
@ -28,10 +28,10 @@ class HrTimer {
this.dataStore.destroy(id);
}
return;
};
}
store = (): void => {
public store(): void {
return this.dataStore;
};
}
}
export default HrTimer;

View File

@ -1,7 +1,7 @@
import { performance, PerformanceObserver } from 'perf_hooks';
import DataStore from './dataStore';
class PerfTimer {
obs: $TSFixMe;
private obs: $TSFixMe;
private dataStore;
private apiUrl;
private appId;
@ -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);
@ -26,17 +26,17 @@ class PerfTimer {
this.obs.observe({ entryTypes: ['measure'] });
}
start = (id: $TSFixMe, log: $TSFixMe): void => {
public start (id: $TSFixMe, log: $TSFixMe): void {
this.dataStore.setValue(id, log);
return performance.mark(`start-${id}`);
};
end = (id: $TSFixMe, result: $TSFixMe, type: $TSFixMe): void => {
public end (id: $TSFixMe, result: $TSFixMe, type: $TSFixMe): void {
performance.mark(`end-${id}`);
return performance.measure(`${type}-${id}`, `start-${id}`, `end-${id}`);
};
store = (): void => {
public store (): void {
return this.dataStore;
};
}

View File

@ -295,8 +295,7 @@ export default class MailService {
try {
await this.transportMail(mail, mailServer);
} catch (error) {
if (mailServer.backupMailServer) {
}
throw error;
}
}
}

View File

@ -31,7 +31,7 @@ const {
const run: Function = async (
functionCode: $TSFixMe,
isCalled: $TSFixMe, // skip IIFE calls
options = { maxScriptRunTime, maxSyncStatementDuration }
options: $TSFixMe = { maxScriptRunTime, maxSyncStatementDuration }
): void => {
if (isMainThread) {
// modifiable option in development mode only

View File

@ -1938,7 +1938,7 @@ export default (state: $TSFixMe = INITIAL_STATE, action: Action): void => {
const timelineIds: $TSFixMe = [];
let singleTimeline: $TSFixMe = false;
let timelines: $TSFixMe = state.lastIncidentTimelines.timelines.map(
timeline => {
(timeline: $TSFixMe) => {
if (
String(timeline.incidentId) ===
String(action.payload.incidentId)

View File

@ -15,7 +15,10 @@ const initialState: $TSFixMe = {
success: false,
};
export default function register(state: $TSFixMe = initialState, action: Action): void {
export default function register(
state: $TSFixMe = initialState,
action: Action
): void {
switch (action.type) {
case types.VALIDATE_TOKEN_REQUEST:
return Object.assign({}, state, {