diff --git a/App/FeatureSet/Identity/API/SSO.ts b/App/FeatureSet/Identity/API/SSO.ts index 5be9b410ac..17f5796f42 100644 --- a/App/FeatureSet/Identity/API/SSO.ts +++ b/App/FeatureSet/Identity/API/SSO.ts @@ -40,8 +40,10 @@ import Name from "Common/Types/Name"; const router: ExpressRouter = Express.getRouter(); -// This route is used to get the SSO config for the user. -// when the user logs in from OneUptime and not from the IDP. +/* + * This route is used to get the SSO config for the user. + * when the user logs in from OneUptime and not from the IDP. + */ router.get( "/service-provider-login", @@ -434,8 +436,10 @@ const loginUserWithSso: LoginUserWithSsoFunction = async ( isNewUser = true; } - // If he does not then add him to teams that he should belong and log in. - // This should never happen because email is verified before he logs in with SSO. + /* + * If he does not then add him to teams that he should belong and log in. + * This should never happen because email is verified before he logs in with SSO. + */ if (!alreadySavedUser.isEmailVerified && !isNewUser) { await AuthenticationEmail.sendVerificationEmail(alreadySavedUser!); diff --git a/App/FeatureSet/Identity/Utils/SSO.ts b/App/FeatureSet/Identity/Utils/SSO.ts index 63afd713b8..53cec1e59f 100644 --- a/App/FeatureSet/Identity/Utils/SSO.ts +++ b/App/FeatureSet/Identity/Utils/SSO.ts @@ -184,15 +184,17 @@ export default class SSOUtil { return null; } - // get displayName attribute. - // { - // "$": { - // "Name": "http://schemas.microsoft.com/identity/claims/displayname" - // }, - // "AttributeValue": [ - // "Nawaz Dhandala" - // ] - // }, + /* + * get displayName attribute. + * { + * "$": { + * "Name": "http://schemas.microsoft.com/identity/claims/displayname" + * }, + * "AttributeValue": [ + * "Nawaz Dhandala" + * ] + * }, + */ for (let i: number = 0; i < samlAttribute.length; i++) { const attribute: JSONObject = samlAttribute[i] as JSONObject; diff --git a/App/FeatureSet/Notification/Services/CallService.ts b/App/FeatureSet/Notification/Services/CallService.ts index cc28d332c9..e998c40029 100644 --- a/App/FeatureSet/Notification/Services/CallService.ts +++ b/App/FeatureSet/Notification/Services/CallService.ts @@ -47,9 +47,11 @@ function extractSayMessagesFromCallRequest(callRequest: CallRequest): string { if ((item as GatherInput).introMessage) { sayMessages.push((item as GatherInput).introMessage); } - // NOTE: Excluding noInputMessage and onInputCallRequest messages from summary - // as they contain system responses like "Good bye", "Invalid input", "You have acknowledged" - // which should not be included in the call summary according to user requirements + /* + * NOTE: Excluding noInputMessage and onInputCallRequest messages from summary + * as they contain system responses like "Good bye", "Invalid input", "You have acknowledged" + * which should not be included in the call summary according to user requirements + */ } } diff --git a/Common/Models/DatabaseModels/OnCallDutyPolicyUserOverride.ts b/Common/Models/DatabaseModels/OnCallDutyPolicyUserOverride.ts index 4ee44eca2e..c180cc6711 100644 --- a/Common/Models/DatabaseModels/OnCallDutyPolicyUserOverride.ts +++ b/Common/Models/DatabaseModels/OnCallDutyPolicyUserOverride.ts @@ -132,9 +132,11 @@ export default class OnCallDutyPolicyUserOverride extends BaseModel { }) public projectId?: ObjectID = undefined; - // If this is null then it's a global override - // If this is set then it's a policy specific override - // Policy specifc override will take precedence over global override + /* + * If this is null then it's a global override + * If this is set then it's a policy specific override + * Policy specifc override will take precedence over global override + */ @ColumnAccessControl({ create: [ diff --git a/Common/Models/DatabaseModels/Project.ts b/Common/Models/DatabaseModels/Project.ts index a436ec74aa..23118f6e34 100644 --- a/Common/Models/DatabaseModels/Project.ts +++ b/Common/Models/DatabaseModels/Project.ts @@ -1292,8 +1292,10 @@ export default class Project extends TenantModel { }) public letCustomerSupportAccessProject?: boolean = undefined; - // This is an internal field. This is used for internal analytics for example: Metabase. - // Values can be between 0 and 100. + /* + * This is an internal field. This is used for internal analytics for example: Metabase. + * Values can be between 0 and 100. + */ @ColumnAccessControl({ create: [], read: [], diff --git a/Common/Models/DatabaseModels/ProjectSmtpConfig.ts b/Common/Models/DatabaseModels/ProjectSmtpConfig.ts index 5c35b1eead..066765a570 100755 --- a/Common/Models/DatabaseModels/ProjectSmtpConfig.ts +++ b/Common/Models/DatabaseModels/ProjectSmtpConfig.ts @@ -336,8 +336,10 @@ export default class ProjectSmtpConfig extends BaseModel { }) public deletedByUserId?: ObjectID = undefined; - // This is not required because some SMTP servers do not require authentication. - // eg: https://learn.microsoft.com/en-us/exchange/mail-flow-best-practices/how-to-set-up-a-multifunction-device-or-application-to-send-email-using-microsoft-365-or-office-365#option-2-send-mail-directly-from-your-printer-or-application-to-microsoft-365-or-office-365-direct-send + /* + * This is not required because some SMTP servers do not require authentication. + * eg: https://learn.microsoft.com/en-us/exchange/mail-flow-best-practices/how-to-set-up-a-multifunction-device-or-application-to-send-email-using-microsoft-365-or-office-365#option-2-send-mail-directly-from-your-printer-or-application-to-microsoft-365-or-office-365-direct-send + */ @ColumnAccessControl({ create: [ Permission.ProjectOwner, diff --git a/Common/Models/DatabaseModels/StatusPageDomain.ts b/Common/Models/DatabaseModels/StatusPageDomain.ts index a5ed589306..91d59f27aa 100644 --- a/Common/Models/DatabaseModels/StatusPageDomain.ts +++ b/Common/Models/DatabaseModels/StatusPageDomain.ts @@ -420,10 +420,12 @@ export default class StatusPageDomain extends BaseModel { @JoinColumn({ name: "deletedByUserId" }) public deletedByUser?: User = undefined; - // This token is used by the Worker. - // worker pings the status page of customers - eg: status.company.com/verify-token/:id - // and the end point on Status Page project returns 200. - // when that happens the isCnameVerified is set to True and the certificate is added to Greenlock. + /* + * This token is used by the Worker. + * worker pings the status page of customers - eg: status.company.com/verify-token/:id + * and the end point on Status Page project returns 200. + * when that happens the isCnameVerified is set to True and the certificate is added to Greenlock. + */ @ColumnAccessControl({ create: [ Permission.ProjectOwner, diff --git a/Common/Server/API/BaseAPI.ts b/Common/Server/API/BaseAPI.ts index 98043c1719..1f04ba692c 100644 --- a/Common/Server/API/BaseAPI.ts +++ b/Common/Server/API/BaseAPI.ts @@ -235,8 +235,10 @@ export default class BaseAPI< ): Promise { await this.onBeforeList(req, res); - // Extract pagination parameters from query or body (for POST requests) - // Support both 'skip' and 'offset' parameters (offset is alias for skip) + /* + * Extract pagination parameters from query or body (for POST requests) + * Support both 'skip' and 'offset' parameters (offset is alias for skip) + */ let skipValue: number = 0; let limitValue: number = DEFAULT_LIMIT; diff --git a/Common/Server/API/GlobalConfigAPI.ts b/Common/Server/API/GlobalConfigAPI.ts index 1e79ae9b51..b20290e755 100644 --- a/Common/Server/API/GlobalConfigAPI.ts +++ b/Common/Server/API/GlobalConfigAPI.ts @@ -21,20 +21,24 @@ export default class GlobalConfigAPI extends BaseAPI< `${new this.entityType().getCrudApiPath()?.toString()}/vars`, async (req: ExpressRequest, res: ExpressResponse, next: NextFunction) => { try { - // const globalConfig: GlobalConfig | null = - // await GlobalConfigService.findOneById({ - // id: ObjectID.getZeroObjectID(), - // select: { - // useHttps: true, - // }, - // props: { - // isRoot: true, - // }, - // }); + /* + * const globalConfig: GlobalConfig | null = + * await GlobalConfigService.findOneById({ + * id: ObjectID.getZeroObjectID(), + * select: { + * useHttps: true, + * }, + * props: { + * isRoot: true, + * }, + * }); + */ return Response.sendJsonObjectResponse(req, res, { - // USE_HTTPS: - // globalConfig?.useHttps?.toString() || 'false', + /* + * USE_HTTPS: + * globalConfig?.useHttps?.toString() || 'false', + */ }); } catch (err) { next(err); diff --git a/Common/Server/API/MicrosoftTeamsAPI.ts b/Common/Server/API/MicrosoftTeamsAPI.ts index a0a3fd49c1..25edc4a63e 100644 --- a/Common/Server/API/MicrosoftTeamsAPI.ts +++ b/Common/Server/API/MicrosoftTeamsAPI.ts @@ -227,9 +227,11 @@ export default class MicrosoftTeamsAPI { }, ); - // Microsoft Teams OAuth callback endpoint for project integration - // New (preferred) static redirect URI that uses state param to carry projectId and userId - // State format: : + /* + * Microsoft Teams OAuth callback endpoint for project integration + * New (preferred) static redirect URI that uses state param to carry projectId and userId + * State format: : + */ router.get( "/microsoft-teams/auth", async (req: ExpressRequest, res: ExpressResponse) => { @@ -509,9 +511,11 @@ export default class MicrosoftTeamsAPI { ); } - // Persist project auth now that team is selected. - // IMPORTANT: Do NOT overwrite project-level auth token (admin-consent app token) - // with the user delegated token. Preserve existing project auth token if present. + /* + * Persist project auth now that team is selected. + * IMPORTANT: Do NOT overwrite project-level auth token (admin-consent app token) + * with the user delegated token. Preserve existing project auth token if present. + */ const existingProjectAuth: WorkspaceProjectAuthToken | null = await WorkspaceProjectAuthTokenService.getProjectAuth({ projectId: projectId, @@ -569,8 +573,10 @@ export default class MicrosoftTeamsAPI { }, ); - // Admin consent - start flow (tenant-wide admin consent) - // Uses state in the same format as OAuth: : + /* + * Admin consent - start flow (tenant-wide admin consent) + * Uses state in the same format as OAuth: : + */ router.get( "/microsoft-teams/admin-consent", async (req: ExpressRequest, res: ExpressResponse) => { @@ -651,8 +657,10 @@ export default class MicrosoftTeamsAPI { }, ); - // Admin consent - callback handler - // Receives: state=:, tenant=, admin_consent=True | error params + /* + * Admin consent - callback handler + * Receives: state=:, tenant=, admin_consent=True | error params + */ router.get( "/microsoft-teams/admin-consent/callback", async (req: ExpressRequest, res: ExpressResponse) => { @@ -912,8 +920,10 @@ export default class MicrosoftTeamsAPI { }, ); - // Microsoft Bot Framework endpoint - this is what Teams calls for bot messages - // Now uses the Bot Framework SDK's adapter.processActivity for proper protocol handling + /* + * Microsoft Bot Framework endpoint - this is what Teams calls for bot messages + * Now uses the Bot Framework SDK's adapter.processActivity for proper protocol handling + */ router.post( "/microsoft-bot/messages", async (req: ExpressRequest, res: ExpressResponse) => { @@ -1150,9 +1160,11 @@ export default class MicrosoftTeamsAPI { authResult: MicrosoftTeamsRequest, _activity: JSONObject, ): Promise { - // Handle adaptive card button clicks - // const value: JSONObject = activity["value"] as JSONObject; - // const actionType: string = value["action"] as string; + /* + * Handle adaptive card button clicks + * const value: JSONObject = activity["value"] as JSONObject; + * const actionType: string = value["action"] as string; + */ for (const action of authResult.actions || []) { if (!action.actionType) { diff --git a/Common/Server/API/ResellerPlanAPI.ts b/Common/Server/API/ResellerPlanAPI.ts index 45ddde0d83..ab5873ac54 100644 --- a/Common/Server/API/ResellerPlanAPI.ts +++ b/Common/Server/API/ResellerPlanAPI.ts @@ -30,8 +30,10 @@ export default class ResellerPlanAPI extends BaseAPI< public constructor() { super(ResellerPlan, ResellerPlanService); - // Reseller Plan Action API - // TODO: Refactor this API and make it partner specific. + /* + * Reseller Plan Action API + * TODO: Refactor this API and make it partner specific. + */ this.router.post( `${new this.entityType() .getCrudApiPath() diff --git a/Common/Server/API/SlackAPI.ts b/Common/Server/API/SlackAPI.ts index 3036645e39..7eb0213fa2 100644 --- a/Common/Server/API/SlackAPI.ts +++ b/Common/Server/API/SlackAPI.ts @@ -181,29 +181,31 @@ export default class SlackAPI { let botUserId: string | undefined = undefined; let slackUserAccessToken: string | undefined = undefined; - // ReponseBody is in this format. - // { - // "ok": true, - // "access_token": "sample-token", - // "token_type": "bot", - // "scope": "commands,incoming-webhook", - // "bot_user_id": "U0KRQLJ9H", - // "app_id": "A0KRD7HC3", - // "team": { - // "name": "Slack Pickleball Team", - // "id": "T9TK3CUKW" - // }, - // "enterprise": { - // "name": "slack-pickleball", - // "id": "E12345678" - // }, - // "authed_user": { - // "id": "U1234", - // "scope": "chat:write", - // "access_token": "sample-token", - // "token_type": "user" - // } - // } + /* + * ReponseBody is in this format. + * { + * "ok": true, + * "access_token": "sample-token", + * "token_type": "bot", + * "scope": "commands,incoming-webhook", + * "bot_user_id": "U0KRQLJ9H", + * "app_id": "A0KRD7HC3", + * "team": { + * "name": "Slack Pickleball Team", + * "id": "T9TK3CUKW" + * }, + * "enterprise": { + * "name": "slack-pickleball", + * "id": "E12345678" + * }, + * "authed_user": { + * "id": "U1234", + * "scope": "chat:write", + * "access_token": "sample-token", + * "token_type": "user" + * } + * } + */ if (responseBody["ok"] !== true) { return Response.sendErrorResponse( @@ -407,31 +409,35 @@ export default class SlackAPI { "id_token" ] as JSONObject; - // Example of Response Body - // { - // "iss": "https://slack.com", - // "sub": "U123ABC456", - // "aud": "25259531569.1115258246291", - // "exp": 1626874955, - // "iat": 1626874655, - // "auth_time": 1626874655, - // "nonce": "abcd", - // "at_hash": "abc...123", - // "https://slack.com/team_id": "T0123ABC456", - // "https://slack.com/user_id": "U123ABC456", - // "email": "alice@example.com", - // "email_verified": true, - // "date_email_verified": 1622128723, - // "locale": "en-US", - // "name": "Alice", - // "given_name": "", - // "family_name": "", - // "https://slack.com/team_image_230": "https://secure.gravatar.com/avatar/bc.png", - // "https://slack.com/team_image_default": true - // } + /* + * Example of Response Body + * { + * "iss": "https://slack.com", + * "sub": "U123ABC456", + * "aud": "25259531569.1115258246291", + * "exp": 1626874955, + * "iat": 1626874655, + * "auth_time": 1626874655, + * "nonce": "abcd", + * "at_hash": "abc...123", + * "https://slack.com/team_id": "T0123ABC456", + * "https://slack.com/user_id": "U123ABC456", + * "email": "alice@example.com", + * "email_verified": true, + * "date_email_verified": 1622128723, + * "locale": "en-US", + * "name": "Alice", + * "given_name": "", + * "family_name": "", + * "https://slack.com/team_image_230": "https://secure.gravatar.com/avatar/bc.png", + * "https://slack.com/team_image_default": true + * } + */ - // check if the team id matches the project id. - // get project auth. + /* + * check if the team id matches the project id. + * get project auth. + */ const projectAuth: WorkspaceProjectAuthToken | null = await WorkspaceProjectAuthTokenService.findOneBy({ diff --git a/Common/Server/API/StatusPageAPI.ts b/Common/Server/API/StatusPageAPI.ts index dd0afb354c..8ca806dea8 100644 --- a/Common/Server/API/StatusPageAPI.ts +++ b/Common/Server/API/StatusPageAPI.ts @@ -735,9 +735,11 @@ export default class StatusPageAPI extends BaseAPI< req: req, }); - // get start and end date from request body. - // if no end date is provided then it will be current date. - // if no start date is provided then it will be 14 days ago from end date. + /* + * get start and end date from request body. + * if no end date is provided then it will be current date. + * if no start date is provided then it will be 14 days ago from end date. + */ let startDate: Date = OneUptimeDate.getSomeDaysAgo(14); let endDate: Date = OneUptimeDate.getCurrentDate(); diff --git a/Common/Server/API/UserOnCallLogTimelineAPI.ts b/Common/Server/API/UserOnCallLogTimelineAPI.ts index 1c336cea93..3d8f84b106 100644 --- a/Common/Server/API/UserOnCallLogTimelineAPI.ts +++ b/Common/Server/API/UserOnCallLogTimelineAPI.ts @@ -93,9 +93,11 @@ export default class UserNotificationLogTimelineAPI extends BaseAPI< }, ); - // We have this ack page to show the user a confirmation page before acknowledging the notification. - // this is because email clients automatically make a get request to the url in the email and ack the notification automatically which is not what we want. - // so we need to create this page for the user to confirm that they want to acknowledge the notification. + /* + * We have this ack page to show the user a confirmation page before acknowledging the notification. + * this is because email clients automatically make a get request to the url in the email and ack the notification automatically which is not what we want. + * so we need to create this page for the user to confirm that they want to acknowledge the notification. + */ this.router.get( `${new this.entityType() .getCrudApiPath() diff --git a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1753131488925-AddEnableCustomSubscriberEmailNotificationFooterText.ts b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1753131488925-AddEnableCustomSubscriberEmailNotificationFooterText.ts index 4875f37698..aeb8494f11 100644 --- a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1753131488925-AddEnableCustomSubscriberEmailNotificationFooterText.ts +++ b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1753131488925-AddEnableCustomSubscriberEmailNotificationFooterText.ts @@ -11,8 +11,10 @@ export class AddEnableCustomSubscriberEmailNotificationFooterText1753131488925 `ALTER TABLE "StatusPage" ADD "enableCustomSubscriberEmailNotificationFooterText" boolean NOT NULL DEFAULT false`, ); - // Data migration: Set existing status pages to have enableCustomSubscriberEmailNotificationFooterText = true - // This ensures backward compatibility for existing status pages that already have custom footer text + /* + * Data migration: Set existing status pages to have enableCustomSubscriberEmailNotificationFooterText = true + * This ensures backward compatibility for existing status pages that already have custom footer text + */ await queryRunner.query( `UPDATE "StatusPage" SET "enableCustomSubscriberEmailNotificationFooterText" = true WHERE "subscriberEmailNotificationFooterText" IS NOT NULL AND "subscriberEmailNotificationFooterText" != ''`, ); diff --git a/Common/Server/Infrastructure/Queue.ts b/Common/Server/Infrastructure/Queue.ts index 79089b6eac..671e24060e 100644 --- a/Common/Server/Infrastructure/Queue.ts +++ b/Common/Server/Infrastructure/Queue.ts @@ -93,8 +93,10 @@ export default class Queue { removeOnComplete: { count: 500 }, // keep last 1000 completed jobs removeOnFail: { count: 100 }, // keep last 500 failed jobs }, - // Optionally cap the event stream length (supported in BullMQ >= v5) - // This helps prevent the :events stream from growing indefinitely + /* + * Optionally cap the event stream length (supported in BullMQ >= v5) + * This helps prevent the :events stream from growing indefinitely + */ streams: { events: { maxLen: 1000 }, }, diff --git a/Common/Server/Infrastructure/SocketIO.ts b/Common/Server/Infrastructure/SocketIO.ts index 1e0c3875f2..1536bec0fb 100644 --- a/Common/Server/Infrastructure/SocketIO.ts +++ b/Common/Server/Infrastructure/SocketIO.ts @@ -26,8 +26,10 @@ export default abstract class IO { ); } - // const pubClient: ClientType = Redis.getClient()!.duplicate(); - // const subClient: ClientType = Redis.getClient()!.duplicate(); + /* + * const pubClient: ClientType = Redis.getClient()!.duplicate(); + * const subClient: ClientType = Redis.getClient()!.duplicate(); + */ // this.socketServer.adapter(createAdapter(pubClient, subClient)); } diff --git a/Common/Server/Middleware/ProjectAuthorization.ts b/Common/Server/Middleware/ProjectAuthorization.ts index 3c2112c1ca..209389f554 100644 --- a/Common/Server/Middleware/ProjectAuthorization.ts +++ b/Common/Server/Middleware/ProjectAuthorization.ts @@ -107,9 +107,11 @@ export default class ProjectMiddleware { if (apiKeyModel) { (req as OneUptimeRequest).userType = UserType.API; - // TODO: Add API key permissions. - // (req as OneUptimeRequest).permissions = - // apiKeyModel.permissions || []; + /* + * TODO: Add API key permissions. + * (req as OneUptimeRequest).permissions = + * apiKeyModel.permissions || []; + */ (req as OneUptimeRequest).userGlobalAccessPermission = await APIKeyAccessPermission.getDefaultApiGlobalPermission( tenantId, diff --git a/Common/Server/Middleware/TelemetryIngest.ts b/Common/Server/Middleware/TelemetryIngest.ts index 13895e8b99..4492030acc 100644 --- a/Common/Server/Middleware/TelemetryIngest.ts +++ b/Common/Server/Middleware/TelemetryIngest.ts @@ -44,8 +44,10 @@ export default class TelemetryIngest { logger.error("Missing header: x-oneuptime-token"); if (isOpenTelemetryAPI) { - // then accept the response and return success. - // do not return error because it causes Otel to retry the request. + /* + * then accept the response and return success. + * do not return error because it causes Otel to retry the request. + */ return Response.sendEmptySuccessResponse(req, res); } @@ -71,8 +73,10 @@ export default class TelemetryIngest { logger.error("Invalid service token: " + oneuptimeToken); if (isOpenTelemetryAPI) { - // then accept the response and return success. - // do not return error because it causes Otel to retry the request. + /* + * then accept the response and return success. + * do not return error because it causes Otel to retry the request. + */ return Response.sendEmptySuccessResponse(req, res); } @@ -89,8 +93,10 @@ export default class TelemetryIngest { ); if (isOpenTelemetryAPI) { - // then accept the response and return success. - // do not return error because it causes Otel to retry the request. + /* + * then accept the response and return success. + * do not return error because it causes Otel to retry the request. + */ return Response.sendEmptySuccessResponse(req, res); } diff --git a/Common/Server/Services/AlertStateTimelineService.ts b/Common/Server/Services/AlertStateTimelineService.ts index 471c3bf347..caa689bfa3 100644 --- a/Common/Server/Services/AlertStateTimelineService.ts +++ b/Common/Server/Services/AlertStateTimelineService.ts @@ -145,8 +145,10 @@ export class Service extends DatabaseService { createBy.data.isOwnerNotified = true; } - // check if this new state and the previous state are same. - // if yes, then throw bad data exception. + /* + * check if this new state and the previous state are same. + * if yes, then throw bad data exception. + */ if (stateBeforeThis && stateBeforeThis.alertStateId && alertStateId) { if ( @@ -211,8 +213,10 @@ export class Service extends DatabaseService { createBy.data.endsAt = stateAfterThis.startsAt; } - // check if this new state and the previous state are same. - // if yes, then throw bad data exception. + /* + * check if this new state and the previous state are same. + * if yes, then throw bad data exception. + */ if (stateAfterThis && stateAfterThis.alertStateId && alertStateId) { if ( @@ -295,14 +299,18 @@ export class Service extends DatabaseService { logger.debug("Created Item"); logger.debug(createdItem); - // now there are three cases. - // 1. This is the first status OR there's no status after this. + /* + * now there are three cases. + * 1. This is the first status OR there's no status after this. + */ if (!onCreate.carryForward.statusTimelineBeforeThisStatus) { // This is the first status, no need to update previous status. logger.debug("This is the first status."); } else if (!onCreate.carryForward.statusTimelineAfterThisStatus) { - // 2. This is the last status. - // Update the previous status to end at the start of this status. + /* + * 2. This is the last status. + * Update the previous status to end at the start of this status. + */ await this.updateOneById({ id: onCreate.carryForward.statusTimelineBeforeThisStatus.id!, data: { @@ -314,8 +322,10 @@ export class Service extends DatabaseService { }); logger.debug("This is the last status."); } else { - // 3. This is in the middle. - // Update the previous status to end at the start of this status. + /* + * 3. This is in the middle. + * Update the previous status to end at the start of this status. + */ await this.updateOneById({ id: onCreate.carryForward.statusTimelineBeforeThisStatus.id!, data: { @@ -549,10 +559,12 @@ ${createdItem.rootCause}`, ); } - // There are three cases. - // 1. This is the first state. - // 2. This is the last state. - // 3. This is in the middle. + /* + * There are three cases. + * 1. This is the first state. + * 2. This is the last state. + * 3. This is in the middle. + */ const stateBeforeThis: AlertStateTimeline | null = await this.findOneBy( { @@ -601,8 +613,10 @@ ${createdItem.rootCause}`, // This is the first state, no need to update previous state. logger.debug("This is the first state."); } else if (!stateAfterThis) { - // This is the last state. - // Update the previous state to end at the end of this state. + /* + * This is the last state. + * Update the previous state to end at the end of this state. + */ await this.updateOneById({ id: stateBeforeThis.id!, data: { @@ -614,8 +628,10 @@ ${createdItem.rootCause}`, }); logger.debug("This is the last state."); } else { - // This state is in the middle. - // Update the previous state to end at the start of the next state. + /* + * This state is in the middle. + * Update the previous state to end at the start of the next state. + */ await this.updateOneById({ id: stateBeforeThis.id!, data: { diff --git a/Common/Server/Services/BillingInvoiceService.ts b/Common/Server/Services/BillingInvoiceService.ts index f60681fe64..0dc9228f70 100644 --- a/Common/Server/Services/BillingInvoiceService.ts +++ b/Common/Server/Services/BillingInvoiceService.ts @@ -67,8 +67,10 @@ export class Service extends DatabaseService { }, }); - // refresh the subscription status. This is a hack to ensure that the subscription status is always up to date. - // This is because the subscription status can change at any time and we need to ensure that the subscription status is always up to date. + /* + * refresh the subscription status. This is a hack to ensure that the subscription status is always up to date. + * This is because the subscription status can change at any time and we need to ensure that the subscription status is always up to date. + */ if (!project) { throw new BadDataException("Project not found"); @@ -207,8 +209,10 @@ export class Service extends DatabaseService { }, }); - // refresh the subscription status. This is a hack to ensure that the subscription status is always up to date. - // This is because the subscription status can change at any time and we need to ensure that the subscription status is always up to date. + /* + * refresh the subscription status. This is a hack to ensure that the subscription status is always up to date. + * This is because the subscription status can change at any time and we need to ensure that the subscription status is always up to date. + */ await this.refreshSubscriptionStatus({ projectId: findBy.props.tenantId! }); diff --git a/Common/Server/Services/BillingService.ts b/Common/Server/Services/BillingService.ts index 0650811442..40b2cde218 100644 --- a/Common/Server/Services/BillingService.ts +++ b/Common/Server/Services/BillingService.ts @@ -90,13 +90,15 @@ export class BillingService extends BaseService { if (!this.isBillingEnabled()) { throw new BadDataException(Errors.BillingService.BILLING_NOT_ENABLED); } - // Goal: Update Stripe Customer "Billing details" (address fields) rather than invoice footer. - // We only have a single free-form textarea. We'll map: - // First non-empty line -> address.line1 - // Second non-empty line (if any) and remaining (joined, truncated) -> address.line2 - // We also persist full text in metadata so we can reconstruct or improve parsing later. - // NOTE: Because Stripe requires structured address, any city/state/postal/country detection - // would be heuristic; we keep it simple unless we later add structured fields. + /* + * Goal: Update Stripe Customer "Billing details" (address fields) rather than invoice footer. + * We only have a single free-form textarea. We'll map: + * First non-empty line -> address.line1 + * Second non-empty line (if any) and remaining (joined, truncated) -> address.line2 + * We also persist full text in metadata so we can reconstruct or improve parsing later. + * NOTE: Because Stripe requires structured address, any city/state/postal/country detection + * would be heuristic; we keep it simple unless we later add structured fields. + */ const lines: Array = businessDetails .split(/\r?\n/) @@ -137,8 +139,10 @@ export class BillingService extends BaseService { address: {}, }; - // If finance / accounting email provided, set it as the customer email so Stripe sends - // invoices / receipts there. (Stripe only supports a single email via API currently.) + /* + * If finance / accounting email provided, set it as the customer email so Stripe sends + * invoices / receipts there. (Stripe only supports a single email via API currently.) + */ if (financeAccountingEmail && financeAccountingEmail.trim().length > 0) { updateParams.email = financeAccountingEmail.trim(); } diff --git a/Common/Server/Services/DatabaseService.ts b/Common/Server/Services/DatabaseService.ts index c5b87610f7..c04346cfb9 100644 --- a/Common/Server/Services/DatabaseService.ts +++ b/Common/Server/Services/DatabaseService.ts @@ -1090,21 +1090,25 @@ class DatabaseService extends BaseService { }, }); - // We are hard deleting anyway. So, this does not make sense. Please uncomment if - // we change the code to soft-delete. + /* + * We are hard deleting anyway. So, this does not make sense. Please uncomment if + * we change the code to soft-delete. + */ - // await this._updateBy({ - // query: deleteBy.query, - // data: { - // deletedByUserId: deleteBy.props.userId, - // } as any, - // limit: deleteBy.limit, - // skip: deleteBy.skip, - // props: { - // isRoot: true, - // ignoreHooks: true, - // }, - // }); + /* + * await this._updateBy({ + * query: deleteBy.query, + * data: { + * deletedByUserId: deleteBy.props.userId, + * } as any, + * limit: deleteBy.limit, + * skip: deleteBy.skip, + * props: { + * isRoot: true, + * ignoreHooks: true, + * }, + * }); + */ let numberOfDocsAffected: number = 0; @@ -1407,9 +1411,11 @@ class DatabaseService extends BaseService { for (const key of dataKeys) { dataColumns.push([key, true]); } - // Select the `_id` column and the columns in `data`. - // `_id` is used for locating database records for updates, and `data` - // columns are used for checking if the update causes a change in values. + /* + * Select the `_id` column and the columns in `data`. + * `_id` is used for locating database records for updates, and `data` + * columns are used for checking if the update causes a change in values. + */ const selectColumns: Select = { _id: true, ...Object.fromEntries(dataColumns), @@ -1467,16 +1473,20 @@ class DatabaseService extends BaseService { } } - // Cant Update relations. - // https://github.com/typeorm/typeorm/issues/2821 + /* + * Cant Update relations. + * https://github.com/typeorm/typeorm/issues/2821 + */ - // const numberOfDocsAffected: number = - // ( - // await this.getRepository().update( - // query as any, - // data - // ) - // ).affected || 0; + /* + * const numberOfDocsAffected: number = + * ( + * await this.getRepository().update( + * query as any, + * data + * ) + * ).affected || 0; + */ if (!updateBy.props.ignoreHooks) { await this.onUpdateSuccess( @@ -1499,8 +1509,10 @@ class DatabaseService extends BaseService { const columns: string[] = Object.keys(updatedItem); for (const column of columns) { if ( - // `toString()` is necessary so we can compare wrapped values - // (e.g. `ObjectID`) with raw values (e.g. `string`) + /* + * `toString()` is necessary so we can compare wrapped values + * (e.g. `ObjectID`) with raw values (e.g. `string`) + */ item.getColumnValue(column)?.toString() !== updatedItem[column]?.toString() ) { diff --git a/Common/Server/Services/IncidentService.ts b/Common/Server/Services/IncidentService.ts index 0918244779..73be79d901 100644 --- a/Common/Server/Services/IncidentService.ts +++ b/Common/Server/Services/IncidentService.ts @@ -343,9 +343,11 @@ export class Service extends DatabaseService { protected override async onBeforeUpdate( updateBy: UpdateBy, ): Promise> { - // get monitors for this incident. - // if the monitors are removed then change them to operational state. - // then change all of the monitors in this incident to the changeMonitorStatusToId. + /* + * get monitors for this incident. + * if the monitors are removed then change them to operational state. + * then change all of the monitors in this incident to the changeMonitorStatusToId. + */ const carryForward: UpdateCarryForward = {}; diff --git a/Common/Server/Services/IncidentStateTimelineService.ts b/Common/Server/Services/IncidentStateTimelineService.ts index 88d7d5ba21..20939b59bd 100644 --- a/Common/Server/Services/IncidentStateTimelineService.ts +++ b/Common/Server/Services/IncidentStateTimelineService.ts @@ -169,8 +169,10 @@ export class Service extends DatabaseService { createBy.data.isOwnerNotified = true; } - // check if this new state and the previous state are same. - // if yes, then throw bad data exception. + /* + * check if this new state and the previous state are same. + * if yes, then throw bad data exception. + */ if ( stateBeforeThis && @@ -222,8 +224,10 @@ export class Service extends DatabaseService { createBy.data.endsAt = stateAfterThis.startsAt; } - // check if this new state and the previous state are same. - // if yes, then throw bad data exception. + /* + * check if this new state and the previous state are same. + * if yes, then throw bad data exception. + */ if (stateAfterThis && stateAfterThis.incidentStateId && incidentStateId) { if ( @@ -314,14 +318,18 @@ export class Service extends DatabaseService { logger.debug("Created Item"); logger.debug(createdItem); - // now there are three cases. - // 1. This is the first status OR there's no status after this. + /* + * now there are three cases. + * 1. This is the first status OR there's no status after this. + */ if (!onCreate.carryForward.statusTimelineBeforeThisStatus) { // This is the first status, no need to update previous status. logger.debug("This is the first status."); } else if (!onCreate.carryForward.statusTimelineAfterThisStatus) { - // 2. This is the last status. - // Update the previous status to end at the start of this status. + /* + * 2. This is the last status. + * Update the previous status to end at the start of this status. + */ await this.updateOneById({ id: onCreate.carryForward.statusTimelineBeforeThisStatus.id!, data: { @@ -333,8 +341,10 @@ export class Service extends DatabaseService { }); logger.debug("This is the last status."); } else { - // 3. This is in the middle. - // Update the previous status to end at the start of this status. + /* + * 3. This is in the middle. + * Update the previous status to end at the start of this status. + */ await this.updateOneById({ id: onCreate.carryForward.statusTimelineBeforeThisStatus.id!, data: { @@ -598,10 +608,12 @@ ${createdItem.rootCause}`, ); } - // There are three cases. - // 1. This is the first state. - // 2. This is the last state. - // 3. This is in the middle. + /* + * There are three cases. + * 1. This is the first state. + * 2. This is the last state. + * 3. This is in the middle. + */ const stateBeforeThis: IncidentStateTimeline | null = await this.findOneBy({ @@ -650,8 +662,10 @@ ${createdItem.rootCause}`, // This is the first state, no need to update previous state. logger.debug("This is the first state."); } else if (!stateAfterThis) { - // This is the last state. - // Update the previous state to end at the end of this state. + /* + * This is the last state. + * Update the previous state to end at the end of this state. + */ await this.updateOneById({ id: stateBeforeThis.id!, data: { @@ -663,8 +677,10 @@ ${createdItem.rootCause}`, }); logger.debug("This is the last state."); } else { - // This state is in the middle. - // Update the previous state to end at the start of the next state. + /* + * This state is in the middle. + * Update the previous state to end at the start of the next state. + */ await this.updateOneById({ id: stateBeforeThis.id!, data: { diff --git a/Common/Server/Services/MonitorStatusTimelineService.ts b/Common/Server/Services/MonitorStatusTimelineService.ts index fffc434fa6..c29d85627b 100644 --- a/Common/Server/Services/MonitorStatusTimelineService.ts +++ b/Common/Server/Services/MonitorStatusTimelineService.ts @@ -107,8 +107,10 @@ export class Service extends DatabaseService { createBy.data.isOwnerNotified = true; } - // check if this new state and the previous state are same. - // if yes, then throw bad data exception. + /* + * check if this new state and the previous state are same. + * if yes, then throw bad data exception. + */ if (stateBeforeThis && stateBeforeThis.monitorStatusId && monitorStatusId) { if ( @@ -144,8 +146,10 @@ export class Service extends DatabaseService { createBy.data.endsAt = stateAfterThis.startsAt; } - // check if this new state and the previous state are same. - // if yes, then throw bad data exception. + /* + * check if this new state and the previous state are same. + * if yes, then throw bad data exception. + */ if (stateAfterThis && stateAfterThis.monitorStatusId && monitorStatusId) { if ( @@ -194,14 +198,18 @@ export class Service extends DatabaseService { logger.debug("Created Item"); logger.debug(createdItem); - // now there are three cases. - // 1. This is the first status OR there's no status after this. + /* + * now there are three cases. + * 1. This is the first status OR there's no status after this. + */ if (!onCreate.carryForward.statusTimelineBeforeThisStatus) { // This is the first status, no need to update previous status. logger.debug("This is the first status."); } else if (!onCreate.carryForward.statusTimelineAfterThisStatus) { - // 2. This is the last status. - // Update the previous status to end at the start of this status. + /* + * 2. This is the last status. + * Update the previous status to end at the start of this status. + */ await this.updateOneById({ id: onCreate.carryForward.statusTimelineBeforeThisStatus.id!, data: { @@ -213,8 +221,10 @@ export class Service extends DatabaseService { }); logger.debug("This is the last status."); } else { - // 3. This is in the middle. - // Update the previous status to end at the start of this status. + /* + * 3. This is in the middle. + * Update the previous status to end at the start of this status. + */ await this.updateOneById({ id: onCreate.carryForward.statusTimelineBeforeThisStatus.id!, data: { @@ -358,10 +368,12 @@ export class Service extends DatabaseService { ); } - // There are three cases. - // 1. This is the first status. - // 2. This is the last status. - // 3. This is in the middle. + /* + * There are three cases. + * 1. This is the first status. + * 2. This is the last status. + * 3. This is in the middle. + */ const stateBeforeThis: MonitorStatusTimeline | null = await this.findOneBy({ @@ -410,8 +422,10 @@ export class Service extends DatabaseService { // This is the first status, no need to update previous status. logger.debug("This is the first status."); } else if (!stateAfterThis) { - // This is the last status. - // Update the previous status to end at the start of this status. + /* + * This is the last status. + * Update the previous status to end at the start of this status. + */ await this.updateOneById({ id: stateBeforeThis.id!, data: { @@ -423,8 +437,10 @@ export class Service extends DatabaseService { }); logger.debug("This is the last status."); } else { - // This status is in the middle. - // Update the previous status to end at the start of this status. + /* + * This status is in the middle. + * Update the previous status to end at the start of this status. + */ await this.updateOneById({ id: stateBeforeThis.id!, data: { diff --git a/Common/Server/Services/OnCallDutyPolicyScheduleService.ts b/Common/Server/Services/OnCallDutyPolicyScheduleService.ts index 024fd9826f..3eb6ddb793 100644 --- a/Common/Server/Services/OnCallDutyPolicyScheduleService.ts +++ b/Common/Server/Services/OnCallDutyPolicyScheduleService.ts @@ -181,8 +181,10 @@ export class Service extends DatabaseService { const { previousInformation, newInformation } = data; - // if there's a change, witht he current user, send notification to the new current user. - // Send notificiation to the new current user. + /* + * if there's a change, witht he current user, send notification to the new current user. + * Send notificiation to the new current user. + */ if ( previousInformation.currentUserIdOnRoster?.toString() !== newInformation.currentUserIdOnRoster?.toString() || diff --git a/Common/Server/Services/ProjectService.ts b/Common/Server/Services/ProjectService.ts index f5a05bc6b6..565025ff0d 100755 --- a/Common/Server/Services/ProjectService.ts +++ b/Common/Server/Services/ProjectService.ts @@ -139,10 +139,12 @@ export class ProjectService extends DatabaseService { data.data.planName = this.getPlanType(data.data.paymentProviderPlanId); if (data.data.paymentProviderPromoCode) { - // check if it exists in promcode table. Not all promocodes are in the table, only reseller ones are. - // If they are not in the table, allow projetc creation to proceed. - // If they are in the project table, then see if anyn restrictions on reseller plan apply and if it does, - // apply those restictions to the project. + /* + * check if it exists in promcode table. Not all promocodes are in the table, only reseller ones are. + * If they are not in the table, allow projetc creation to proceed. + * If they are in the project table, then see if anyn restrictions on reseller plan apply and if it does, + * apply those restictions to the project. + */ const promoCode: PromoCode | null = await PromoCodeService.findOneBy({ query: { diff --git a/Common/Server/Services/ScheduledMaintenanceStateTimelineService.ts b/Common/Server/Services/ScheduledMaintenanceStateTimelineService.ts index 60f6faa941..d6330833e5 100644 --- a/Common/Server/Services/ScheduledMaintenanceStateTimelineService.ts +++ b/Common/Server/Services/ScheduledMaintenanceStateTimelineService.ts @@ -326,14 +326,18 @@ export class Service extends DatabaseService logger.debug("Created Item"); logger.debug(createdItem); - // now there are three cases. - // 1. This is the first status OR there's no status after this. + /* + * now there are three cases. + * 1. This is the first status OR there's no status after this. + */ if (!onCreate.carryForward.statusTimelineBeforeThisStatus) { // This is the first status, no need to update previous status. logger.debug("This is the first status."); } else if (!onCreate.carryForward.statusTimelineAfterThisStatus) { - // 2. This is the last status. - // Update the previous status to end at the start of this status. + /* + * 2. This is the last status. + * Update the previous status to end at the start of this status. + */ await this.updateOneById({ id: onCreate.carryForward.statusTimelineBeforeThisStatus.id!, data: { @@ -345,8 +349,10 @@ export class Service extends DatabaseService }); logger.debug("This is the last status."); } else { - // 3. This is in the middle. - // Update the previous status to end at the start of this status. + /* + * 3. This is in the middle. + * Update the previous status to end at the start of this status. + */ await this.updateOneById({ id: onCreate.carryForward.statusTimelineBeforeThisStatus.id!, data: { @@ -718,10 +724,12 @@ export class Service extends DatabaseService ); } - // There are three cases. - // 1. This is the first state. - // 2. This is the last state. - // 3. This is in the middle. + /* + * There are three cases. + * 1. This is the first state. + * 2. This is the last state. + * 3. This is in the middle. + */ const stateBeforeThis: ScheduledMaintenanceStateTimeline | null = await this.findOneBy({ @@ -770,8 +778,10 @@ export class Service extends DatabaseService // This is the first state, no need to update previous state. logger.debug("This is the first state."); } else if (!stateAfterThis) { - // This is the last state. - // Update the previous state to end at the end of this state. + /* + * This is the last state. + * Update the previous state to end at the end of this state. + */ await this.updateOneById({ id: stateBeforeThis.id!, data: { @@ -783,8 +793,10 @@ export class Service extends DatabaseService }); logger.debug("This is the last state."); } else { - // This state is in the middle. - // Update the previous state to end at the start of the next state. + /* + * This state is in the middle. + * Update the previous state to end at the start of the next state. + */ await this.updateOneById({ id: stateBeforeThis.id!, data: { diff --git a/Common/Server/Services/StatusPageService.ts b/Common/Server/Services/StatusPageService.ts index 5634dd4603..8791a74189 100755 --- a/Common/Server/Services/StatusPageService.ts +++ b/Common/Server/Services/StatusPageService.ts @@ -168,8 +168,10 @@ export class Service extends DatabaseService { createBy.data.defaultBarColor = Green; } - // For new status pages, set enableCustomSubscriberEmailNotificationFooterText to false by default - // and provide a default custom footer text only if not provided + /* + * For new status pages, set enableCustomSubscriberEmailNotificationFooterText to false by default + * and provide a default custom footer text only if not provided + */ if ( createBy.data.enableCustomSubscriberEmailNotificationFooterText === undefined diff --git a/Common/Server/Types/AnalyticsDatabase/ModelPermission.ts b/Common/Server/Types/AnalyticsDatabase/ModelPermission.ts index 2dbb9f5828..040f56f4a0 100644 --- a/Common/Server/Types/AnalyticsDatabase/ModelPermission.ts +++ b/Common/Server/Types/AnalyticsDatabase/ModelPermission.ts @@ -252,8 +252,10 @@ export default class ModelPermission { DatabaseRequestType.Read, ); - // We will check for this permission in recursive function. - // check query permissions. + /* + * We will check for this permission in recursive function. + * check query permissions. + */ this.checkQueryPermission(modelType, query, props); if (select) { @@ -393,9 +395,11 @@ export default class ModelPermission { !props.tenantId && props.userGlobalAccessPermission ) { - // for each of these projectIds, - // check if they have valid permissions for these projects - // and if they do, include them in the query. + /* + * for each of these projectIds, + * check if they have valid permissions for these projects + * and if they do, include them in the query. + */ const queries: Array> = []; diff --git a/Common/Server/Types/Database/Permissions/BasePermission.ts b/Common/Server/Types/Database/Permissions/BasePermission.ts index 26cd9a2579..bd26d86170 100644 --- a/Common/Server/Types/Database/Permissions/BasePermission.ts +++ b/Common/Server/Types/Database/Permissions/BasePermission.ts @@ -66,8 +66,10 @@ export default class BasePermission { // check model level permissions. TablePermission.checkTableLevelPermissions(modelType, props, type); - // We will check for this permission in recursive function. - // check query permissions. + /* + * We will check for this permission in recursive function. + * check query permissions. + */ QueryPermission.checkQueryPermission(modelType, query, props); query = await AccessControlPermission.addAccessControlIdsToQuery( diff --git a/Common/Server/Types/Database/Permissions/TenantPermission.ts b/Common/Server/Types/Database/Permissions/TenantPermission.ts index 2069430374..ed2ba55371 100644 --- a/Common/Server/Types/Database/Permissions/TenantPermission.ts +++ b/Common/Server/Types/Database/Permissions/TenantPermission.ts @@ -44,9 +44,11 @@ export default class TenantPermission { !props.tenantId && props.userGlobalAccessPermission ) { - // for each of these projectIds, - // check if they have valid permissions for these projects - // and if they do, include them in the query. + /* + * for each of these projectIds, + * check if they have valid permissions for these projects + * and if they do, include them in the query. + */ const queries: Array> = []; diff --git a/Common/Server/Types/Database/QueryHelper.ts b/Common/Server/Types/Database/QueryHelper.ts index 19ce8fd64d..b49b44158a 100644 --- a/Common/Server/Types/Database/QueryHelper.ts +++ b/Common/Server/Types/Database/QueryHelper.ts @@ -463,8 +463,10 @@ export default class QueryHelper { } return Raw((alias: string) => { - // alias is table name + column name like tableName.columnName - // we need to convert this to "tableName"."columnName" + /* + * alias is table name + column name like tableName.columnName + * we need to convert this to "tableName"."columnName" + */ alias = alias .split(".") diff --git a/Common/Server/Types/Markdown.ts b/Common/Server/Types/Markdown.ts index 411ab84124..ea796aab4b 100644 --- a/Common/Server/Types/Markdown.ts +++ b/Common/Server/Types/Markdown.ts @@ -198,10 +198,12 @@ export default class Markdown { return `
${text}
${text || ""}
`; }; - // Links - // We explicitly add underline + color classes because Tailwind Typography (prose-*) - // styles may get overridden by surrounding utility classes or global resets. - // External links open in a new tab with proper rel attributes; internal links stay in-page. + /* + * Links + * We explicitly add underline + color classes because Tailwind Typography (prose-*) + * styles may get overridden by surrounding utility classes or global resets. + * External links open in a new tab with proper rel attributes; internal links stay in-page. + */ renderer.link = function (href, title, text) { // Guard: if no href, just return the text. if (!href) { diff --git a/Common/Server/Types/Workflow/ComponentCode.ts b/Common/Server/Types/Workflow/ComponentCode.ts index 18aa492cd9..56518525c9 100644 --- a/Common/Server/Types/Workflow/ComponentCode.ts +++ b/Common/Server/Types/Workflow/ComponentCode.ts @@ -1,5 +1,7 @@ -// this class is the base class that all the component can implement -// +/* + * this class is the base class that all the component can implement + * + */ import BadDataException from "../../../Types/Exception/BadDataException"; import Exception from "../../../Types/Exception/Exception"; import { JSONArray, JSONObject, JSONValue } from "../../../Types/JSON"; diff --git a/Common/Server/Types/Workflow/Components/Conditions/IfElse.ts b/Common/Server/Types/Workflow/Components/Conditions/IfElse.ts index 0fe9f341d0..a5d6807a72 100644 --- a/Common/Server/Types/Workflow/Components/Conditions/IfElse.ts +++ b/Common/Server/Types/Workflow/Components/Conditions/IfElse.ts @@ -55,9 +55,11 @@ export default class IfElse extends ComponentCode { } try { - // Set timeout - // Inject args - // Inject dependencies + /* + * Set timeout + * Inject args + * Inject dependencies + */ for (const key in args) { if (key === "operator") { diff --git a/Common/Server/Types/Workflow/Components/JavaScript.ts b/Common/Server/Types/Workflow/Components/JavaScript.ts index 5d1d246b86..462f3d7705 100644 --- a/Common/Server/Types/Workflow/Components/JavaScript.ts +++ b/Common/Server/Types/Workflow/Components/JavaScript.ts @@ -51,9 +51,11 @@ export default class JavaScriptCode extends ComponentCode { } try { - // Set timeout - // Inject args - // Inject dependencies + /* + * Set timeout + * Inject args + * Inject dependencies + */ let scriptArgs: JSONObject | string = (args["arguments"] as JSONObject | string) || {}; diff --git a/Common/Server/Types/Workflow/TriggerCode.ts b/Common/Server/Types/Workflow/TriggerCode.ts index 626bea0b62..c0ee647bbe 100644 --- a/Common/Server/Types/Workflow/TriggerCode.ts +++ b/Common/Server/Types/Workflow/TriggerCode.ts @@ -1,5 +1,7 @@ -// this class is the base class that all the component can implement -// +/* + * this class is the base class that all the component can implement + * + */ import { ExpressRouter } from "../../Utils/Express"; import ComponentCode, { RunOptions, RunReturnType } from "./ComponentCode"; import BadDataException from "../../../Types/Exception/BadDataException"; diff --git a/Common/Server/Utils/AnalyticsDatabase/Statement.ts b/Common/Server/Utils/AnalyticsDatabase/Statement.ts index de6568d8be..8b547e16b6 100644 --- a/Common/Server/Utils/AnalyticsDatabase/Statement.ts +++ b/Common/Server/Utils/AnalyticsDatabase/Statement.ts @@ -159,8 +159,10 @@ export class Statement implements BaseQueryParams { private static toColumnType( statementParam: StatementParameter | string, ): string { - // ensure we have a mapping for all types (a missing mapping will - // be a compile error) + /* + * ensure we have a mapping for all types (a missing mapping will + * be a compile error) + */ const columnTypes: Dictionary = { [TableColumnType.Text]: "String", [TableColumnType.ObjectID]: "String", diff --git a/Common/Server/Utils/AnalyticsDatabase/StatementGenerator.ts b/Common/Server/Utils/AnalyticsDatabase/StatementGenerator.ts index a622e37964..b37dc076a1 100644 --- a/Common/Server/Utils/AnalyticsDatabase/StatementGenerator.ts +++ b/Common/Server/Utils/AnalyticsDatabase/StatementGenerator.ts @@ -131,8 +131,10 @@ export default class StatementGenerator { records.push(record); } - // we need async insert to be enabled for clickhouse to work. - // otherwise too many parts will be created. + /* + * we need async insert to be enabled for clickhouse to work. + * otherwise too many parts will be created. + */ const statement: string = `INSERT INTO ${ this.database.getDatasourceOptions().database @@ -263,9 +265,11 @@ export default class StatementGenerator { setStatement.append(SQL`, `); } - // special case - ClickHouse does not support using query - // parameters for column names in the SET statement so we - // have to trust the column names here. + /* + * special case - ClickHouse does not support using query + * parameters for column names in the SET statement so we + * have to trust the column names here. + */ const keyStatement: string = column.key; setStatement.append(keyStatement).append( @@ -505,8 +509,10 @@ export default class StatementGenerator { statement: Statement; columns: Array; } { - // EXAMPLE: - // SELECT sum(Metric.value) as avg_value, date_trunc('hour', toStartOfInterval(createdAt, INTERVAL 1 hour)) as createdAt + /* + * EXAMPLE: + * SELECT sum(Metric.value) as avg_value, date_trunc('hour', toStartOfInterval(createdAt, INTERVAL 1 hour)) as createdAt + */ const selectStatement: Statement = new Statement(); @@ -578,8 +584,10 @@ export default class StatementGenerator { columns.append(SQL`, `); } - // special case - ClickHouse does not support using an a query parameter - // to specify the column name when creating the table + /* + * special case - ClickHouse does not support using an a query parameter + * to specify the column name when creating the table + */ const keyStatement: string = column.key; columns @@ -683,8 +691,10 @@ export default class StatementGenerator { this.model.tableColumns, ); - // special case - ClickHouse does not support using a query parameter - // to specify the table engine + /* + * special case - ClickHouse does not support using a query parameter + * to specify the table engine + */ const tableEngineStatement: string = this.model.tableEngine; const partitionKey: string = this.model.partitionKey; diff --git a/Common/Server/Utils/Browser.ts b/Common/Server/Utils/Browser.ts index 743164d863..d111b12096 100644 --- a/Common/Server/Utils/Browser.ts +++ b/Common/Server/Utils/Browser.ts @@ -78,10 +78,12 @@ export default class BrowserUtil { page = await browser.newPage(); } - // if (data.browserType === BrowserType.Webkit) { - // browser = await webkit.launch(); - // page = await browser.newPage(); - // } + /* + * if (data.browserType === BrowserType.Webkit) { + * browser = await webkit.launch(); + * page = await browser.newPage(); + * } + */ await page?.setViewportSize({ width: viewport.width, diff --git a/Common/Server/Utils/CodeRepository/GitHub/GitHub.ts b/Common/Server/Utils/CodeRepository/GitHub/GitHub.ts index e54e8d9d51..d517cadc44 100644 --- a/Common/Server/Utils/CodeRepository/GitHub/GitHub.ts +++ b/Common/Server/Utils/CodeRepository/GitHub/GitHub.ts @@ -141,8 +141,10 @@ export default class GitHubUtil extends HostedCodeRepository { page: page, }); - // Fetch all pull requests by paginating through the results - // 100 pull requests per page is the limit of the GitHub API + /* + * Fetch all pull requests by paginating through the results + * 100 pull requests per page is the limit of the GitHub API + */ while (pullRequests.length === page * 100 || page === 1) { pullRequests = await this.getPullRequestsByPage({ organizationName: data.organizationName, diff --git a/Common/Server/Utils/Monitor/MonitorResource.ts b/Common/Server/Utils/Monitor/MonitorResource.ts index 72fc5d267f..1425c850ff 100644 --- a/Common/Server/Utils/Monitor/MonitorResource.ts +++ b/Common/Server/Utils/Monitor/MonitorResource.ts @@ -572,8 +572,10 @@ export default class MonitorResourceUtil { lastMonitorStatusTimeline.monitorStatusId.toString() === monitorSteps.data.defaultMonitorStatusId.toString() ) { - // status is same as last status. do not create new status timeline. - // do nothing! status is same as last status. + /* + * status is same as last status. do not create new status timeline. + * do nothing! status is same as last status. + */ } else { // if no criteria is met then update monitor to default state. const monitorStatusTimeline: MonitorStatusTimeline = @@ -634,9 +636,11 @@ export default class MonitorResourceUtil { const itemsToSave: Array = []; - // Metric name to serviceId map - // example: "cpu.usage" -> [serviceId1, serviceId2] - // since these are monitor metrics. They dont belong to any service so we can keep the array empty. + /* + * Metric name to serviceId map + * example: "cpu.usage" -> [serviceId1, serviceId2] + * since these are monitor metrics. They dont belong to any service so we can keep the array empty. + */ const metricNameServiceNameMap: Dictionary = {}; if ( @@ -1147,8 +1151,10 @@ export default class MonitorResourceUtil { probeApiIngestResponse: ProbeApiIngestResponse; criteriaInstance: MonitorCriteriaInstance; }): Promise { - // returns root cause if any. Otherwise criteria is not met. - // process monitor criteria instance here. + /* + * returns root cause if any. Otherwise criteria is not met. + * process monitor criteria instance here. + */ const rootCause: string | null = await MonitorResourceUtil.isMonitorInstanceCriteriaFiltersMet({ @@ -1227,8 +1233,10 @@ export default class MonitorResourceUtil { criteriaInstance: MonitorCriteriaInstance; criteriaFilter: CriteriaFilter; }): Promise { - // returns root cause if any. Otherwise criteria is not met. - // process monitor criteria filter here. + /* + * returns root cause if any. Otherwise criteria is not met. + * process monitor criteria filter here. + */ if (input.criteriaFilter.checkOn === CheckOn.JavaScriptExpression) { let storageMap: JSONObject = {}; diff --git a/Common/Server/Utils/Realtime.ts b/Common/Server/Utils/Realtime.ts index a8766eedd5..bd5469d6f6 100644 --- a/Common/Server/Utils/Realtime.ts +++ b/Common/Server/Utils/Realtime.ts @@ -92,8 +92,10 @@ export default abstract class Realtime { await this.init(); } - // before joining room check the user token and check if the user has access to this tenant - // and to this model and to this event type + /* + * before joining room check the user token and check if the user has access to this tenant + * and to this model and to this event type + */ logger.debug("Extracting user access token from socket"); const userAccessToken: string | undefined = diff --git a/Common/Server/Utils/Telemetry.ts b/Common/Server/Utils/Telemetry.ts index f8209369f5..5a6bb04b7d 100644 --- a/Common/Server/Utils/Telemetry.ts +++ b/Common/Server/Utils/Telemetry.ts @@ -1,7 +1,9 @@ import OpenTelemetryAPI, { - // diag, - // DiagConsoleLogger, - // DiagLogLevel, + /* + * diag, + * DiagConsoleLogger, + * DiagLogLevel, + */ Meter, } from "@opentelemetry/api"; import { Logger, logs } from "@opentelemetry/api-logs"; @@ -33,8 +35,10 @@ import Dictionary from "../../Types/Dictionary"; import { DisableTelemetry } from "../EnvironmentConfig"; import logger from "./Logger"; -// Enable this line to see debug logs -// diag.setLogger(new DiagConsoleLogger(), DiagLogLevel.DEBUG); +/* + * Enable this line to see debug logs + * diag.setLogger(new DiagConsoleLogger(), DiagLogLevel.DEBUG); + */ export type Span = opentelemetry.api.Span; export type SpanStatus = opentelemetry.api.SpanStatus; @@ -203,10 +207,12 @@ export default class Telemetry { nodeSdkConfiguration.traceExporter = traceExporter; } - // We will skip this becasue we're attachng this metric reader to the meter provider later. - // if (this.metricReader) { - // nodeSdkConfiguration.metricReader = this.metricReader; - // } + /* + * We will skip this becasue we're attachng this metric reader to the meter provider later. + * if (this.metricReader) { + * nodeSdkConfiguration.metricReader = this.metricReader; + * } + */ if (logRecordProcessor) { nodeSdkConfiguration.logRecordProcessor = logRecordProcessor; diff --git a/Common/Server/Utils/Workspace/MicrosoftTeams/Actions/Auth.ts b/Common/Server/Utils/Workspace/MicrosoftTeams/Actions/Auth.ts index 38007a5781..d211c124b9 100644 --- a/Common/Server/Utils/Workspace/MicrosoftTeams/Actions/Auth.ts +++ b/Common/Server/Utils/Workspace/MicrosoftTeams/Actions/Auth.ts @@ -194,8 +194,10 @@ export default class MicrosoftTeamsAuthAction { teamsUserId: string; projectId: ObjectID; }): Promise { - // Find a OneUptime user associated with this Teams user ID using WorkspaceUserAuthToken table - // This table is populated when users authenticate with Microsoft Teams through the OAuth flow + /* + * Find a OneUptime user associated with this Teams user ID using WorkspaceUserAuthToken table + * This table is populated when users authenticate with Microsoft Teams through the OAuth flow + */ try { // Look up the user in the WorkspaceUserAuthToken table diff --git a/Common/Server/Utils/Workspace/MicrosoftTeams/Actions/Incident.ts b/Common/Server/Utils/Workspace/MicrosoftTeams/Actions/Incident.ts index 7cf89b887d..dc058dc661 100644 --- a/Common/Server/Utils/Workspace/MicrosoftTeams/Actions/Incident.ts +++ b/Common/Server/Utils/Workspace/MicrosoftTeams/Actions/Incident.ts @@ -97,8 +97,10 @@ export default class MicrosoftTeamsIncidentActions { return await this.showNewIncidentCard(data); case MicrosoftTeamsIncidentActionType.SubmitNewIncident: - // This is handled by handleBotIncidentAction through bot framework - // Don't process it here to avoid duplicate messages + /* + * This is handled by handleBotIncidentAction through bot framework + * Don't process it here to avoid duplicate messages + */ break; default: @@ -902,8 +904,10 @@ export default class MicrosoftTeamsIncidentActions { teamsRequest.projectId, ); - // Send card as a message (note: in real Teams bot, this would be sent via TurnContext) - // For now, we'll just log it. The actual sending will be done through the bot framework + /* + * Send card as a message (note: in real Teams bot, this would be sent via TurnContext) + * For now, we'll just log it. The actual sending will be done through the bot framework + */ logger.debug("New incident card built:"); logger.debug(JSON.stringify(card, null, 2)); } diff --git a/Common/Server/Utils/Workspace/MicrosoftTeams/Actions/ScheduledMaintenance.ts b/Common/Server/Utils/Workspace/MicrosoftTeams/Actions/ScheduledMaintenance.ts index 019939a490..37261a1a74 100644 --- a/Common/Server/Utils/Workspace/MicrosoftTeams/Actions/ScheduledMaintenance.ts +++ b/Common/Server/Utils/Workspace/MicrosoftTeams/Actions/ScheduledMaintenance.ts @@ -78,8 +78,10 @@ export default class MicrosoftTeamsScheduledMaintenanceActions { return await this.showNewScheduledMaintenanceCard(data); case MicrosoftTeamsScheduledMaintenanceActionType.SubmitNewScheduledMaintenance: - // This is handled by handleBotScheduledMaintenanceAction through bot framework - // Don't process it here to avoid duplicate messages + /* + * This is handled by handleBotScheduledMaintenanceAction through bot framework + * Don't process it here to avoid duplicate messages + */ break; default: @@ -603,8 +605,10 @@ export default class MicrosoftTeamsScheduledMaintenanceActions { teamsRequest.projectId, ); - // Send card as a message (note: in real Teams bot, this would be sent via TurnContext) - // For now, we'll just log it. The actual sending will be done through the bot framework + /* + * Send card as a message (note: in real Teams bot, this would be sent via TurnContext) + * For now, we'll just log it. The actual sending will be done through the bot framework + */ logger.debug("New scheduled maintenance card built:"); logger.debug(JSON.stringify(card, null, 2)); } diff --git a/Common/Server/Utils/Workspace/MicrosoftTeams/Messages/Alert.ts b/Common/Server/Utils/Workspace/MicrosoftTeams/Messages/Alert.ts index 9671761eae..7714cfc1cb 100644 --- a/Common/Server/Utils/Workspace/MicrosoftTeams/Messages/Alert.ts +++ b/Common/Server/Utils/Workspace/MicrosoftTeams/Messages/Alert.ts @@ -32,13 +32,15 @@ export default class MicrosoftTeamsAlertMessages { blockMicrosoftTeams.push(dividerBlock); - // now add buttons. - // View data. - // Execute On Call - // Acknowledge alert - // Resolve data. - // Change Alert State. - // Add Note. + /* + * now add buttons. + * View data. + * Execute On Call + * Acknowledge alert + * Resolve data. + * Change Alert State. + * Add Note. + */ const buttons: Array = []; diff --git a/Common/Server/Utils/Workspace/MicrosoftTeams/Messages/Incident.ts b/Common/Server/Utils/Workspace/MicrosoftTeams/Messages/Incident.ts index acad9f7aec..2f0bd00369 100644 --- a/Common/Server/Utils/Workspace/MicrosoftTeams/Messages/Incident.ts +++ b/Common/Server/Utils/Workspace/MicrosoftTeams/Messages/Incident.ts @@ -32,13 +32,15 @@ export default class MicrosoftTeamsIncidentMessages { blockMicrosoftTeams.push(dividerBlock); - // now add buttons. - // View data. - // Execute On Call - // Acknowledge incident - // Resolve data. - // Change Incident State. - // Add Note. + /* + * now add buttons. + * View data. + * Execute On Call + * Acknowledge incident + * Resolve data. + * Change Incident State. + * Add Note. + */ const buttons: Array = []; diff --git a/Common/Server/Utils/Workspace/MicrosoftTeams/Messages/ScheduledMaintenance.ts b/Common/Server/Utils/Workspace/MicrosoftTeams/Messages/ScheduledMaintenance.ts index da21e329fe..e836e67997 100644 --- a/Common/Server/Utils/Workspace/MicrosoftTeams/Messages/ScheduledMaintenance.ts +++ b/Common/Server/Utils/Workspace/MicrosoftTeams/Messages/ScheduledMaintenance.ts @@ -32,13 +32,15 @@ export default class MicrosoftTeamsScheduledMaintenanceMessages { blockMicrosoftTeams.push(dividerBlock); - // now add buttons. - // View data. - // Execute On Call - // Acknowledge scheduledMaintenance - // Resolve data. - // Change ScheduledMaintenance State. - // Add Note. + /* + * now add buttons. + * View data. + * Execute On Call + * Acknowledge scheduledMaintenance + * Resolve data. + * Change ScheduledMaintenance State. + * Add Note. + */ const buttons: Array = []; diff --git a/Common/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeams.ts b/Common/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeams.ts index 4c9ab44c37..5e1d86ae88 100644 --- a/Common/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeams.ts +++ b/Common/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeams.ts @@ -342,10 +342,12 @@ export default class MicrosoftTeamsUtil extends WorkspaceBase { actionType: MicrosoftTeamsActionType; actionValue: string; } { - // Support multiple shapes that Teams may send for Adaptive Card submits - // 1) { action: "ack-incident", actionValue: "" } - // 2) { data: { action: "ack-incident", actionValue: "" } } - // 3) { action: { type: "Action.Submit", data: { action: "ack-incident", actionValue: "" } } } + /* + * Support multiple shapes that Teams may send for Adaptive Card submits + * 1) { action: "ack-incident", actionValue: "" } + * 2) { data: { action: "ack-incident", actionValue: "" } } + * 3) { action: { type: "Action.Submit", data: { action: "ack-incident", actionValue: "" } } } + */ let actionType: string = (value["action"] as string) || ""; let actionValue: string = (value["actionValue"] as string) || ""; @@ -376,8 +378,10 @@ export default class MicrosoftTeamsUtil extends WorkspaceBase { } private static buildMessageCardFromMarkdown(markdown: string): JSONObject { - // Teams MessageCard has limited markdown support. Headings like '##' are not supported - // and single newlines can collapse. Convert common patterns to a structured card. + /* + * Teams MessageCard has limited markdown support. Headings like '##' are not supported + * and single newlines can collapse. Convert common patterns to a structured card. + */ const lines: Array = markdown .split("\n") .map((l: string) => { diff --git a/Common/Server/Utils/Workspace/Slack/Actions/Alert.ts b/Common/Server/Utils/Workspace/Slack/Actions/Alert.ts index 679577d252..c1ed3dedf4 100644 --- a/Common/Server/Utils/Workspace/Slack/Actions/Alert.ts +++ b/Common/Server/Utils/Workspace/Slack/Actions/Alert.ts @@ -757,8 +757,10 @@ export default class SlackAlertActions { } if (actionType === SlackActionType.ViewAlert) { - // do nothing. This is just a view alert action. - // clear response. + /* + * do nothing. This is just a view alert action. + * clear response. + */ return Response.sendJsonObjectResponse(data.req, data.res, { response_action: "clear", }); diff --git a/Common/Server/Utils/Workspace/Slack/Actions/Auth.ts b/Common/Server/Utils/Workspace/Slack/Actions/Auth.ts index c3e02a030a..697a613b22 100644 --- a/Common/Server/Utils/Workspace/Slack/Actions/Auth.ts +++ b/Common/Server/Utils/Workspace/Slack/Actions/Auth.ts @@ -42,8 +42,10 @@ export interface SlackRequest { const slackActionTypesThatDoNotRequireUserSlackAccountToBeConnectedToOneUptime: Array = [ - // anyone in the company can create incident. - // regardless of whether they are connected to OneUptime or not. + /* + * anyone in the company can create incident. + * regardless of whether they are connected to OneUptime or not. + */ SlackActionType.NewIncident, SlackActionType.SubmitNewIncident, SlackActionType.ViewIncident, diff --git a/Common/Server/Utils/Workspace/Slack/Actions/Incident.ts b/Common/Server/Utils/Workspace/Slack/Actions/Incident.ts index f681d91f76..6c648a2a85 100644 --- a/Common/Server/Utils/Workspace/Slack/Actions/Incident.ts +++ b/Common/Server/Utils/Workspace/Slack/Actions/Incident.ts @@ -258,14 +258,16 @@ export default class SlackIncidentActions { // send response to clear the action. Response.sendTextResponse(data.req, data.res, ""); - // show new incident modal. - // new incident modal is : - // Incident Title (this can be prefilled with actionValue) - // Incident Description - // Incident Severity (dropdown) (single select) - // Monitors (dropdown) (miltiselect) - // Change Monitor Status to (dropdown) (single select) - // Labels (dropdown) (multiselect) + /* + * show new incident modal. + * new incident modal is : + * Incident Title (this can be prefilled with actionValue) + * Incident Description + * Incident Severity (dropdown) (single select) + * Monitors (dropdown) (miltiselect) + * Change Monitor Status to (dropdown) (single select) + * Labels (dropdown) (multiselect) + */ const incidentTitle: WorkspaceTextBoxBlock = { _type: "WorkspaceTextBoxBlock", @@ -1267,8 +1269,10 @@ export default class SlackIncidentActions { } if (actionType === SlackActionType.ViewIncident) { - // do nothing. This is just a view incident action. - // clear response. + /* + * do nothing. This is just a view incident action. + * clear response. + */ return Response.sendJsonObjectResponse(data.req, data.res, { response_action: "clear", }); diff --git a/Common/Server/Utils/Workspace/Slack/Actions/Monitor.ts b/Common/Server/Utils/Workspace/Slack/Actions/Monitor.ts index 740c0efaac..38e41e9ba8 100644 --- a/Common/Server/Utils/Workspace/Slack/Actions/Monitor.ts +++ b/Common/Server/Utils/Workspace/Slack/Actions/Monitor.ts @@ -31,8 +31,10 @@ export default class SlackMonitorActions { const actionType: SlackActionType | undefined = data.action.actionType; if (actionType === SlackActionType.ViewMonitor) { - // do nothing. This is just a view Monitor action. - // clear response. + /* + * do nothing. This is just a view Monitor action. + * clear response. + */ return Response.sendJsonObjectResponse(data.req, data.res, { response_action: "clear", }); diff --git a/Common/Server/Utils/Workspace/Slack/Actions/OnCallDutyPolicy.ts b/Common/Server/Utils/Workspace/Slack/Actions/OnCallDutyPolicy.ts index 207a5052c3..d3534c1011 100644 --- a/Common/Server/Utils/Workspace/Slack/Actions/OnCallDutyPolicy.ts +++ b/Common/Server/Utils/Workspace/Slack/Actions/OnCallDutyPolicy.ts @@ -31,8 +31,10 @@ export default class SlackOnCallDutyActions { const actionType: SlackActionType | undefined = data.action.actionType; if (actionType === SlackActionType.ViewOnCallPolicy) { - // do nothing. This is just a view alert action. - // clear response. + /* + * do nothing. This is just a view alert action. + * clear response. + */ return Response.sendJsonObjectResponse(data.req, data.res, { response_action: "clear", }); diff --git a/Common/Server/Utils/Workspace/Slack/Actions/ScheduledMaintenance.ts b/Common/Server/Utils/Workspace/Slack/Actions/ScheduledMaintenance.ts index 328aa7e560..9380ed680f 100644 --- a/Common/Server/Utils/Workspace/Slack/Actions/ScheduledMaintenance.ts +++ b/Common/Server/Utils/Workspace/Slack/Actions/ScheduledMaintenance.ts @@ -313,14 +313,16 @@ export default class SlackScheduledMaintenanceActions { // send response to clear the action. Response.sendTextResponse(data.req, data.res, ""); - // show new scheduledMaintenance modal. - // new scheduledMaintenance modal is : - // ScheduledMaintenance Title (this can be prefilled with actionValue) - // ScheduledMaintenance Description - // Start Date and Time (date picker) - // End Date and Time (date picker) - // Monitors (dropdown) (miltiselect) - // Change Monitor Status to (dropdown) (single select) + /* + * show new scheduledMaintenance modal. + * new scheduledMaintenance modal is : + * ScheduledMaintenance Title (this can be prefilled with actionValue) + * ScheduledMaintenance Description + * Start Date and Time (date picker) + * End Date and Time (date picker) + * Monitors (dropdown) (miltiselect) + * Change Monitor Status to (dropdown) (single select) + */ // Labels (dropdown) (multiselect) @@ -1092,8 +1094,10 @@ export default class SlackScheduledMaintenanceActions { } if (actionType === SlackActionType.ViewScheduledMaintenance) { - // do nothing. This is just a view scheduledMaintenance action. - // clear response. + /* + * do nothing. This is just a view scheduledMaintenance action. + * clear response. + */ return Response.sendJsonObjectResponse(data.req, data.res, { response_action: "clear", }); diff --git a/Common/Server/Utils/Workspace/Slack/Messages/Alert.ts b/Common/Server/Utils/Workspace/Slack/Messages/Alert.ts index afee6e4364..8bcfb8f212 100644 --- a/Common/Server/Utils/Workspace/Slack/Messages/Alert.ts +++ b/Common/Server/Utils/Workspace/Slack/Messages/Alert.ts @@ -32,13 +32,15 @@ export default class SlackAlertMessages { blockSlack.push(dividerBlock); - // now add buttons. - // View data. - // Execute On Call - // Acknowledge alert - // Resolve data. - // Change Alert State. - // Add Note. + /* + * now add buttons. + * View data. + * Execute On Call + * Acknowledge alert + * Resolve data. + * Change Alert State. + * Add Note. + */ const buttons: Array = []; diff --git a/Common/Server/Utils/Workspace/Slack/Messages/Incident.ts b/Common/Server/Utils/Workspace/Slack/Messages/Incident.ts index f49f1dfe2f..4340aaee28 100644 --- a/Common/Server/Utils/Workspace/Slack/Messages/Incident.ts +++ b/Common/Server/Utils/Workspace/Slack/Messages/Incident.ts @@ -32,13 +32,15 @@ export default class SlackIncidentMessages { blockSlack.push(dividerBlock); - // now add buttons. - // View data. - // Execute On Call - // Acknowledge incident - // Resolve data. - // Change Incident State. - // Add Note. + /* + * now add buttons. + * View data. + * Execute On Call + * Acknowledge incident + * Resolve data. + * Change Incident State. + * Add Note. + */ const buttons: Array = []; diff --git a/Common/Server/Utils/Workspace/Slack/Messages/Monitor.ts b/Common/Server/Utils/Workspace/Slack/Messages/Monitor.ts index f94e870371..38697da7c7 100644 --- a/Common/Server/Utils/Workspace/Slack/Messages/Monitor.ts +++ b/Common/Server/Utils/Workspace/Slack/Messages/Monitor.ts @@ -31,13 +31,15 @@ export default class SlackMonitorMessages { blockSlack.push(dividerBlock); - // now add buttons. - // View data. - // Execute On Call - // Acknowledge Monitor - // Resolve data. - // Change Monitor State. - // Add Note. + /* + * now add buttons. + * View data. + * Execute On Call + * Acknowledge Monitor + * Resolve data. + * Change Monitor State. + * Add Note. + */ const buttons: Array = []; diff --git a/Common/Server/Utils/Workspace/Slack/Messages/ScheduledMaintenance.ts b/Common/Server/Utils/Workspace/Slack/Messages/ScheduledMaintenance.ts index 60b1802389..bc6829231c 100644 --- a/Common/Server/Utils/Workspace/Slack/Messages/ScheduledMaintenance.ts +++ b/Common/Server/Utils/Workspace/Slack/Messages/ScheduledMaintenance.ts @@ -32,13 +32,15 @@ export default class SlackScheduledMaintenanceMessages { blockSlack.push(dividerBlock); - // now add buttons. - // View data. - // Execute On Call - // Acknowledge scheduledMaintenance - // Resolve data. - // Change ScheduledMaintenance State. - // Add Note. + /* + * now add buttons. + * View data. + * Execute On Call + * Acknowledge scheduledMaintenance + * Resolve data. + * Change ScheduledMaintenance State. + * Add Note. + */ const buttons: Array = []; diff --git a/Common/Tests/Server/API/BaseAPI.test.ts b/Common/Tests/Server/API/BaseAPI.test.ts index 2f5184c301..ad8123fca9 100644 --- a/Common/Tests/Server/API/BaseAPI.test.ts +++ b/Common/Tests/Server/API/BaseAPI.test.ts @@ -740,58 +740,70 @@ describe("BaseAPI", () => { }); }); - // describe('createItem', () => { - // let createRequest: OneUptimeRequest; - // let createResponse: ExpressResponse; - // let savedItem: BaseModel; + /* + * describe('createItem', () => { + * let createRequest: OneUptimeRequest; + * let createResponse: ExpressResponse; + * let savedItem: BaseModel; + */ - // beforeEach(() => { - // createRequest = { - // body: { - // data: { version: '1' }, - // miscDataProps: { additional: 'info' }, - // }, - // headers: {}, - // } as unknown as OneUptimeRequest; + /* + * beforeEach(() => { + * createRequest = { + * body: { + * data: { version: '1' }, + * miscDataProps: { additional: 'info' }, + * }, + * headers: {}, + * } as unknown as OneUptimeRequest; + */ - // createResponse = { - // status: jest.fn().mockReturnThis(), - // json: jest.fn().mockReturnThis(), - // send: jest.fn().mockReturnThis(), - // } as unknown as ExpressResponse; + /* + * createResponse = { + * status: jest.fn().mockReturnThis(), + * json: jest.fn().mockReturnThis(), + * send: jest.fn().mockReturnThis(), + * } as unknown as ExpressResponse; + */ - // savedItem = new BaseModel(); - // }); + /* + * savedItem = new BaseModel(); + * }); + */ - // it('should call onBeforeCreate lifecycle method', async () => { - // const onBeforeCreateSpy: jest.SpyInstance = jest.spyOn( - // baseApiInstance as any, - // 'onBeforeCreate' - // ); - // await baseApiInstance.createItem(createRequest, createResponse); - // expect(onBeforeCreateSpy).toHaveBeenCalledWith( - // createRequest, - // createResponse - // ); - // }); + /* + * it('should call onBeforeCreate lifecycle method', async () => { + * const onBeforeCreateSpy: jest.SpyInstance = jest.spyOn( + * baseApiInstance as any, + * 'onBeforeCreate' + * ); + * await baseApiInstance.createItem(createRequest, createResponse); + * expect(onBeforeCreateSpy).toHaveBeenCalledWith( + * createRequest, + * createResponse + * ); + * }); + */ - // it('should return EntityResponse with the saved item', async () => { - // jest.spyOn(baseApiInstance.service, 'create').mockResolvedValue( - // savedItem - // ); - // await baseApiInstance.createItem(createRequest, createResponse); - // const sendEntityResponseSpy: jest.SpyInstance = jest.spyOn( - // Response as any, - // 'sendEntityResponse' - // ); - // expect(sendEntityResponseSpy).toHaveBeenCalledWith( - // createRequest, - // createResponse, - // savedItem, - // BaseModel - // ); - // }); - // }); + /* + * it('should return EntityResponse with the saved item', async () => { + * jest.spyOn(baseApiInstance.service, 'create').mockResolvedValue( + * savedItem + * ); + * await baseApiInstance.createItem(createRequest, createResponse); + * const sendEntityResponseSpy: jest.SpyInstance = jest.spyOn( + * Response as any, + * 'sendEntityResponse' + * ); + * expect(sendEntityResponseSpy).toHaveBeenCalledWith( + * createRequest, + * createResponse, + * savedItem, + * BaseModel + * ); + * }); + * }); + */ describe("getRouter", () => { it("should return an ExpressRouter instance", () => { diff --git a/Common/Tests/Server/Services/TeamMemberService.test.ts b/Common/Tests/Server/Services/TeamMemberService.test.ts index 3f28d9b55e..0082a8ca04 100644 --- a/Common/Tests/Server/Services/TeamMemberService.test.ts +++ b/Common/Tests/Server/Services/TeamMemberService.test.ts @@ -343,10 +343,12 @@ describe("TeamMemberService", () => { "refreshTokens", ); - // const updateSeatsSpy: jest.SpyInstance = jest.spyOn( - // TeamMemberService, - // "updateSubscriptionSeatsByUniqueTeamMembersInProject", - // ); + /* + * const updateSeatsSpy: jest.SpyInstance = jest.spyOn( + * TeamMemberService, + * "updateSubscriptionSeatsByUniqueTeamMembersInProject", + * ); + */ const user: User = await UserService.create({ data: UserServiceHelper.generateRandomUser(), @@ -741,8 +743,10 @@ describe("TeamMemberService", () => { describe("getUniqueTeamMemberCountInProject", () => { it("should return the count of unique team members in a project", async () => { - // make findBy to return 4 team members: 1 normal, 2 with the same id and 1 without a user ID - // total should be 2 unique team members + /* + * make findBy to return 4 team members: 1 normal, 2 with the same id and 1 without a user ID + * total should be 2 unique team members + */ const user: User = await UserServiceHelper.genrateAndSaveRandomUser( null, @@ -839,9 +843,11 @@ describe("TeamMemberService", () => { describe("getUsersInTeam(s)", () => { it("should return users in specified team", async () => { - // team A members: user1 & user2 - // team B members: user2 & user3 - // team C members: user 3 + /* + * team A members: user1 & user2 + * team B members: user2 & user3 + * team C members: user 3 + */ const user: User = await UserServiceHelper.genrateAndSaveRandomUser( null, @@ -966,9 +972,11 @@ describe("TeamMemberService", () => { }); it("should return users in multiple teams", async () => { - // team A members: user1 & user2 - // team B members: user2 & user3 - // team C members: user 3 + /* + * team A members: user1 & user2 + * team B members: user2 & user3 + * team C members: user 3 + */ const user: User = await UserServiceHelper.genrateAndSaveRandomUser( null, diff --git a/Common/Tests/Types/OnCallDutyPolicy/LayerUtil.test.ts b/Common/Tests/Types/OnCallDutyPolicy/LayerUtil.test.ts index 724c1003df..1ce5b9a7d7 100644 --- a/Common/Tests/Types/OnCallDutyPolicy/LayerUtil.test.ts +++ b/Common/Tests/Types/OnCallDutyPolicy/LayerUtil.test.ts @@ -220,8 +220,10 @@ describe("LayerUtil getEvents - Daily Restrictions", () => { calendarEndDate: calendarEnd, }); - // Expect two events: 23:00 -> 23:59:59 (approx) and 00:00 -> 11:00 next day (depending on trimming logic) - // We simplify by checking presence of one starting at 23:00 and one ending at 11:00. + /* + * Expect two events: 23:00 -> 23:59:59 (approx) and 00:00 -> 11:00 next day (depending on trimming logic) + * We simplify by checking presence of one starting at 23:00 and one ending at 11:00. + */ expect(events.length).toBeGreaterThanOrEqual(2); // Expect at least two distinct segments across midnight. const has23Window: boolean = events.some((e: CalendarEvent) => { return OneUptimeDate.getLocalHourAndMinuteFromDate(e.start) === "23:00"; @@ -436,8 +438,10 @@ describe("LayerUtil getEvents - Rotation Handoff", () => { return e.title; }); - // Titles are user ids (strings we passed) according to implementation. - // Check that at least first three rotate u1 -> u2 -> u3 + /* + * Titles are user ids (strings we passed) according to implementation. + * Check that at least first three rotate u1 -> u2 -> u3 + */ expect(userSequence.slice(0, 3)).toEqual(["u1", "u2", "u3"]); }); }); diff --git a/Common/Tests/UI/Components/DictionaryOfStrings.test.tsx b/Common/Tests/UI/Components/DictionaryOfStrings.test.tsx index e4a027386f..903eb045f1 100644 --- a/Common/Tests/UI/Components/DictionaryOfStrings.test.tsx +++ b/Common/Tests/UI/Components/DictionaryOfStrings.test.tsx @@ -1,5 +1,7 @@ -// Libraries -// Custom components +/* + * Libraries + * Custom components + */ import DictionaryOfStrings, { ComponentProps, } from "../../../UI/Components/Dictionary/DictionaryOfStrings"; diff --git a/Common/Tests/Utils/API.test.ts b/Common/Tests/Utils/API.test.ts index 9728d4b424..5752bc0279 100644 --- a/Common/Tests/Utils/API.test.ts +++ b/Common/Tests/Utils/API.test.ts @@ -32,10 +32,12 @@ jest.mock("axios", () => { return Object.assign(jest.fn(), jest.requireActual("axios")); }); -// Mock axios(config) top level function -// Ignore type error -// Property 'lastCall' is optional in type MockFunctionState but required in type MockContext -// @ts-ignore +/* + * Mock axios(config) top level function + * Ignore type error + * Property 'lastCall' is optional in type MockFunctionState but required in type MockContext + * @ts-ignore + */ const mockedAxios: jest.MockedFunctionDeep = jest.mocked(axios); @@ -342,8 +344,10 @@ interface HTTPMethodType { method: HTTPMethod; } -// Set up table-driven tests for -// .get(), .post(), .put(), .delete(), get(), post(), put(), delete() +/* + * Set up table-driven tests for + * .get(), .post(), .put(), .delete(), get(), post(), put(), delete() + */ const httpMethodTests: Array = [ { name: "get", diff --git a/Common/Types/BaseDatabase/DatabaseCommonInteractionPropsUtil.ts b/Common/Types/BaseDatabase/DatabaseCommonInteractionPropsUtil.ts index f16388abdd..8bb435f4dc 100644 --- a/Common/Types/BaseDatabase/DatabaseCommonInteractionPropsUtil.ts +++ b/Common/Types/BaseDatabase/DatabaseCommonInteractionPropsUtil.ts @@ -11,9 +11,11 @@ export default class DatabaseCommonInteractionPropsUtil { props: DatabaseCommonInteractionProps, permissionType: PermissionType, ): Array { - // Check first if the user has Global Permissions. - // Global permissions includes all the tenantId user has access to. - // and it includes all the global permissions that applies to all the tenant, like PUBLIC. + /* + * Check first if the user has Global Permissions. + * Global permissions includes all the tenantId user has access to. + * and it includes all the global permissions that applies to all the tenant, like PUBLIC. + */ if (!props.userGlobalAccessPermission) { props.userGlobalAccessPermission = { globalPermissions: [Permission.Public], diff --git a/Common/Types/Html.ts b/Common/Types/Html.ts index ed4aa7f43f..a960a25644 100644 --- a/Common/Types/Html.ts +++ b/Common/Types/Html.ts @@ -18,9 +18,11 @@ export default class HTML { public static isHtml(text: string): boolean { // Check if the text is HTML - // Example usage const htmlString = '
Hello, World!
'; const notHtmlString = 'Just a regular string' - // console.log(HTML.isHtml(htmlString)); // true - // console.log(HTML.isHtml(notHtmlString)); // false + /* + * Example usage const htmlString = '
Hello, World!
'; const notHtmlString = 'Just a regular string' + * console.log(HTML.isHtml(htmlString)); // true + * console.log(HTML.isHtml(notHtmlString)); // false + */ const htmlPattern: RegExp = /<\/?[a-z][\s\S]*>/i; return htmlPattern.test(text); diff --git a/Common/Types/JSONFunctions.ts b/Common/Types/JSONFunctions.ts index af9687123a..f7fc2d0399 100644 --- a/Common/Types/JSONFunctions.ts +++ b/Common/Types/JSONFunctions.ts @@ -27,11 +27,11 @@ export default class JSONFunctions { // obj could be in this format: /** - * { - "http.url.protocol": "http", - "http.url.hostname": "localhost", - "http.host": "localhost", - */ + * { + *"http.url.protocol": "http", + *"http.url.hostname": "localhost", + *"http.host": "localhost", + */ // we want to convert it to this format: diff --git a/Common/Types/Metrics/MetricsQuery.ts b/Common/Types/Metrics/MetricsQuery.ts index b9a0f86575..36a05c0203 100644 --- a/Common/Types/Metrics/MetricsQuery.ts +++ b/Common/Types/Metrics/MetricsQuery.ts @@ -7,10 +7,12 @@ export default interface MetricsQuery { aggegationType: MetricsAggregationType; aggregateBy: Dictionary; - // This is used for example for probes. - // To display US probe and EU probe in chart for example. - // In this case groupByAttribute is "probeId" - // and attributeValueToLegendMap is { "xx-xx-xx-xx": "US Probe", "yy-yyy-yyy-yy-yy": "EU Probe" } + /* + * This is used for example for probes. + * To display US probe and EU probe in chart for example. + * In this case groupByAttribute is "probeId" + * and attributeValueToLegendMap is { "xx-xx-xx-xx": "US Probe", "yy-yyy-yyy-yy-yy": "EU Probe" } + */ groupByAttribute?: string | undefined; attributeValueToLegendMap?: Dictionary; diff --git a/Common/Types/Monitor/MonitorType.ts b/Common/Types/Monitor/MonitorType.ts index 360a9b8563..c8285db8b3 100644 --- a/Common/Types/Monitor/MonitorType.ts +++ b/Common/Types/Monitor/MonitorType.ts @@ -69,12 +69,14 @@ export class MonitorTypeHelper { description: "This monitor type does the basic ping test of an endpoint.", }, - // { - // monitorType: MonitorType.Kubernetes, - // title: 'Kubernetes', - // description: - // 'This monitor types lets you monitor Kubernetes clusters.', - // }, + /* + * { + * monitorType: MonitorType.Kubernetes, + * title: 'Kubernetes', + * description: + * 'This monitor types lets you monitor Kubernetes clusters.', + * }, + */ { monitorType: MonitorType.IP, title: "IP", diff --git a/Common/Types/OnCallDutyPolicy/Layer.ts b/Common/Types/OnCallDutyPolicy/Layer.ts index aeb9868605..04a2794abc 100644 --- a/Common/Types/OnCallDutyPolicy/Layer.ts +++ b/Common/Types/OnCallDutyPolicy/Layer.ts @@ -663,9 +663,11 @@ export default class LayerUtil { // if start time is after end time, we need to add one week to the end time if (OneUptimeDate.isAfter(startTime, endTime)) { - // in this case the restriction is towards the ends of the week and not in the middle so we need to add two objects to the array. - // One for start of the week - // and the other for end of the week . + /* + * in this case the restriction is towards the ends of the week and not in the middle so we need to add two objects to the array. + * One for start of the week + * and the other for end of the week . + */ const startOfWeek: Date = data.eventStartTime; // add 7 days to the end time to get the end of the week @@ -718,11 +720,13 @@ export default class LayerUtil { let restrictionStartTime: Date = dayRestrictionTimes.startTime; let restrictionEndTime: Date = dayRestrictionTimes.endTime; - // Special Case: Overnight (wrap-around) window where end time is logically on the next day. - // Example: 23:00 -> 11:00 (next day). Existing algorithm assumed end >= start within same day - // and returned no events. We explicitly expand such windows into two segments per day: - // 1) start -> endOfDay(start) - // 2) startOfNextDay -> end (moved to next day) + /* + * Special Case: Overnight (wrap-around) window where end time is logically on the next day. + * Example: 23:00 -> 11:00 (next day). Existing algorithm assumed end >= start within same day + * and returned no events. We explicitly expand such windows into two segments per day: + * 1) start -> endOfDay(start) + * 2) startOfNextDay -> end (moved to next day) + */ if (OneUptimeDate.isBefore(restrictionEndTime, restrictionStartTime)) { const results: Array = []; @@ -1012,9 +1016,11 @@ export default class LayerUtil { public removeOverlappingEvents( events: PriorityCalendarEvents[], ): CalendarEvent[] { - // now remove overlapping events by priority and trim them by priority. Lower priority number will be kept and higher priority number will be trimmed. - // so if there are two events with the same start and end time, we will keep the one with the lower priority number and remove the one with the higher priority number. - // if there are overlapping events, we will trim the one with the higher priority number. + /* + * now remove overlapping events by priority and trim them by priority. Lower priority number will be kept and higher priority number will be trimmed. + * so if there are two events with the same start and end time, we will keep the one with the lower priority number and remove the one with the higher priority number. + * if there are overlapping events, we will trim the one with the higher priority number. + */ // sort the events by priority @@ -1078,14 +1084,18 @@ export default class LayerUtil { ) { // if the current event has a higher priority than the final event, we need to trim the final event if (event.priority < finalEvent.priority) { - // trim the final event based on the current event - // end time of the final event will be the start time of the current event - 1 second + /* + * trim the final event based on the current event + * end time of the final event will be the start time of the current event - 1 second + */ const tempFinalEventEnd: Date = finalEvent.end; finalEvent.end = OneUptimeDate.addRemoveSeconds(event.start, -1); - // check if the final event end time is before the start time of the current event - // if it is, we need to remove the final event from the final events array + /* + * check if the final event end time is before the start time of the current event + * if it is, we need to remove the final event from the final events array + */ if (OneUptimeDate.isBefore(finalEvent.end, finalEvent.start)) { finalEvents.splice(i, 1); i--; // Adjust index after removal @@ -1115,8 +1125,10 @@ export default class LayerUtil { } } } else { - // trim the current event based on the final event - // start time of the current event will be the end time of the final event + 1 second + /* + * trim the current event based on the final event + * start time of the current event will be the end time of the final event + 1 second + */ event.start = OneUptimeDate.addRemoveSeconds(finalEvent.end, 1); } } diff --git a/Common/Types/Phone.ts b/Common/Types/Phone.ts index ccf2bdbb2f..eddfe6885a 100644 --- a/Common/Types/Phone.ts +++ b/Common/Types/Phone.ts @@ -15,9 +15,11 @@ export default class Phone extends DatabaseProperty { primaryPhoneNumberToPickFrom: Phone | string; seocndaryPhoneNumbersToPickFrom: Phone[] | string[]; }): Phone { - // convert all to string, so that we can compare them - // if the country code matches in secondary phone numbers, then pick that number - // if no country code matches, then pick the primary phone number and return it. + /* + * convert all to string, so that we can compare them + * if the country code matches in secondary phone numbers, then pick that number + * if no country code matches, then pick the primary phone number and return it. + */ const to: string = typeof data.to === "string" ? data.to : data.to.toString(); diff --git a/Common/Types/Workspace/NotificationRules/CreateChannelNotificationRule.ts b/Common/Types/Workspace/NotificationRules/CreateChannelNotificationRule.ts index 57a80befcb..48a3402de6 100644 --- a/Common/Types/Workspace/NotificationRules/CreateChannelNotificationRule.ts +++ b/Common/Types/Workspace/NotificationRules/CreateChannelNotificationRule.ts @@ -13,7 +13,9 @@ export default interface CreateChannelNotificationRule shouldInviteOwnersToNewChannel: boolean; newChannelTemplateName: string; - // if selected this would archive channel when incident, alert, scheduled maintenance reaches the last state (is resolved) - // This would only archive the channel which was created. + /* + * if selected this would archive channel when incident, alert, scheduled maintenance reaches the last state (is resolved) + * This would only archive the channel which was created. + */ archiveChannelAutomatically: boolean; } diff --git a/Common/UI/Components/Forms/Types/Field.ts b/Common/UI/Components/Forms/Types/Field.ts index 44b3eab952..226a32a435 100644 --- a/Common/UI/Components/Forms/Types/Field.ts +++ b/Common/UI/Components/Forms/Types/Field.ts @@ -114,8 +114,10 @@ export default interface Field { hideOptionalLabel?: boolean | undefined; - // Spell check configuration (primarily for Markdown and text fields) - // Default: false (spell check enabled). Set to true to disable spell check. + /* + * Spell check configuration (primarily for Markdown and text fields) + * Default: false (spell check enabled). Set to true to disable spell check. + */ disableSpellCheck?: boolean | undefined; getSummaryElement?: (item: FormValues) => ReactElement | undefined; diff --git a/Common/UI/Components/JSONTable/JSONTable.tsx b/Common/UI/Components/JSONTable/JSONTable.tsx index 9cff273c66..12e231f1b6 100644 --- a/Common/UI/Components/JSONTable/JSONTable.tsx +++ b/Common/UI/Components/JSONTable/JSONTable.tsx @@ -46,8 +46,10 @@ const JSONTable: FunctionComponent = ( JSONFunctions.nestJson(json), ) as { [key: string]: any }; - // Post-process flattened keys to group primitive arrays: prefix.0, prefix.1 => prefix: [v0, v1] - // We ONLY group if all matching keys are simple (no deeper nesting like prefix.0.field) + /* + * Post-process flattened keys to group primitive arrays: prefix.0, prefix.1 => prefix: [v0, v1] + * We ONLY group if all matching keys are simple (no deeper nesting like prefix.0.field) + */ type GroupEntry = { index: number; value: unknown }; type GroupMap = { [prefix: string]: Array }; const groupMap: GroupMap = {}; diff --git a/Common/UI/Components/ModelTable/BaseModelTable.tsx b/Common/UI/Components/ModelTable/BaseModelTable.tsx index c7582f0424..e9d8a46982 100644 --- a/Common/UI/Components/ModelTable/BaseModelTable.tsx +++ b/Common/UI/Components/ModelTable/BaseModelTable.tsx @@ -224,9 +224,11 @@ export interface BaseTableProps< formSummary?: FormSummaryConfig | undefined; - // this key is used to save table user preferences in local storage. - // If you provide this key, the table will save the user preferences in local storage. - // If you do not provide this key, the table will not save the user preferences in local storage. + /* + * this key is used to save table user preferences in local storage. + * If you provide this key, the table will save the user preferences in local storage. + * If you do not provide this key, the table will not save the user preferences in local storage. + */ userPreferencesKey: string; } diff --git a/Common/UI/Components/SideMenu/SideMenu.tsx b/Common/UI/Components/SideMenu/SideMenu.tsx index f48595e48a..fd72152a9c 100644 --- a/Common/UI/Components/SideMenu/SideMenu.tsx +++ b/Common/UI/Components/SideMenu/SideMenu.tsx @@ -132,8 +132,10 @@ const SideMenu: FunctionComponent = (props: ComponentProps) => { // Re-run active item detection when location changes useEffect(() => { - // This will trigger a re-render when navigation changes - // The activeItem will be recalculated + /* + * This will trigger a re-render when navigation changes + * The activeItem will be recalculated + */ }, [Navigation.getCurrentPath().toString()]); // Render function for the menu content diff --git a/Common/UI/Components/SideMenu/SideMenuItem.tsx b/Common/UI/Components/SideMenu/SideMenuItem.tsx index f3efdfdbd4..823f2a57ed 100644 --- a/Common/UI/Components/SideMenu/SideMenuItem.tsx +++ b/Common/UI/Components/SideMenu/SideMenuItem.tsx @@ -35,32 +35,44 @@ const SideMenuItem: FunctionComponent = ( subItemLinkClassName = `bg-gray-100 text-indigo-600 hover:bg-white group rounded-md px-3 py-2 flex items-center text-sm font-medium`; } - // if(props.badge && props.badge > 0){ - // if(props.badgeType === BadgeType.DANGER){ - // linkClassName = `text-red-400 hover:text-red-600 hover:bg-gray-100 group rounded-md px-3 py-2 flex items-center text-sm font-medium`; + /* + * if(props.badge && props.badge > 0){ + * if(props.badgeType === BadgeType.DANGER){ + * linkClassName = `text-red-400 hover:text-red-600 hover:bg-gray-100 group rounded-md px-3 py-2 flex items-center text-sm font-medium`; + */ - // if(Navigation.isOnThisPage(props.link.to)){ - // linkClassName = `bg-gray-100 text-red-600 hover:bg-white group rounded-md px-3 py-2 flex items-center text-sm font-medium`; - // } + /* + * if(Navigation.isOnThisPage(props.link.to)){ + * linkClassName = `bg-gray-100 text-red-600 hover:bg-white group rounded-md px-3 py-2 flex items-center text-sm font-medium`; + * } + */ // } - // if(props.badgeType === BadgeType.WARNING){ - // linkClassName = `text-yellow-400 hover:text-yellow-600 hover:bg-gray-100 group rounded-md px-3 py-2 flex items-center text-sm font-medium`; + /* + * if(props.badgeType === BadgeType.WARNING){ + * linkClassName = `text-yellow-400 hover:text-yellow-600 hover:bg-gray-100 group rounded-md px-3 py-2 flex items-center text-sm font-medium`; + */ - // if(Navigation.isOnThisPage(props.link.to)){ - // linkClassName = `bg-gray-100 text-yellow-600 hover:bg-white group rounded-md px-3 py-2 flex items-center text-sm font-medium`; - // } - // } + /* + * if(Navigation.isOnThisPage(props.link.to)){ + * linkClassName = `bg-gray-100 text-yellow-600 hover:bg-white group rounded-md px-3 py-2 flex items-center text-sm font-medium`; + * } + * } + */ - // if(props.badgeType === BadgeType.SUCCESS){ - // linkClassName = `text-emerald-400 hover:text-emerald-600 hover:bg-gray-100 group rounded-md px-3 py-2 flex items-center text-sm font-medium`; + /* + * if(props.badgeType === BadgeType.SUCCESS){ + * linkClassName = `text-emerald-400 hover:text-emerald-600 hover:bg-gray-100 group rounded-md px-3 py-2 flex items-center text-sm font-medium`; + */ - // if(Navigation.isOnThisPage(props.link.to)){ - // linkClassName = `bg-gray-100 text-emerald-600 hover:bg-white group rounded-md px-3 py-2 flex items-center text-sm font-medium`; - // } - // } - // } + /* + * if(Navigation.isOnThisPage(props.link.to)){ + * linkClassName = `bg-gray-100 text-emerald-600 hover:bg-white group rounded-md px-3 py-2 flex items-center text-sm font-medium`; + * } + * } + * } + */ let iconClassName: string = "text-gray-400 group-hover:text-gray-500 flex-shrink-0 -ml-1 mr-3 h-6 w-6"; @@ -76,32 +88,44 @@ const SideMenuItem: FunctionComponent = ( subItemIconClassName = "text-indigo-500 flex-shrink-0 -ml-1 mr-3 h-6 w-6"; } - // if(props.badge && props.badge > 0){ - // if(props.badgeType === BadgeType.DANGER){ - // iconClassName = `text-red-400 group-hover:text-red-500 flex-shrink-0 -ml-1 mr-3 h-6 w-6`; + /* + * if(props.badge && props.badge > 0){ + * if(props.badgeType === BadgeType.DANGER){ + * iconClassName = `text-red-400 group-hover:text-red-500 flex-shrink-0 -ml-1 mr-3 h-6 w-6`; + */ - // if(Navigation.isOnThisPage(props.link.to)){ - // iconClassName = `text-red-500 flex-shrink-0 -ml-1 mr-3 h-6 w-6`; - // } + /* + * if(Navigation.isOnThisPage(props.link.to)){ + * iconClassName = `text-red-500 flex-shrink-0 -ml-1 mr-3 h-6 w-6`; + * } + */ // } - // if(props.badgeType === BadgeType.WARNING){ - // iconClassName = `text-yellow-400 group-hover:text-yellow-500 flex-shrink-0 -ml-1 mr-3 h-6 w-6`; + /* + * if(props.badgeType === BadgeType.WARNING){ + * iconClassName = `text-yellow-400 group-hover:text-yellow-500 flex-shrink-0 -ml-1 mr-3 h-6 w-6`; + */ - // if(Navigation.isOnThisPage(props.link.to)){ - // iconClassName = `text-yellow-500 flex-shrink-0 -ml-1 mr-3 h-6 w-6`; - // } - // } + /* + * if(Navigation.isOnThisPage(props.link.to)){ + * iconClassName = `text-yellow-500 flex-shrink-0 -ml-1 mr-3 h-6 w-6`; + * } + * } + */ - // if(props.badgeType === BadgeType.SUCCESS){ - // iconClassName = `text-emerald-400 group-hover:text-emerald-500 flex-shrink-0 -ml-1 mr-3 h-6 w-6`; + /* + * if(props.badgeType === BadgeType.SUCCESS){ + * iconClassName = `text-emerald-400 group-hover:text-emerald-500 flex-shrink-0 -ml-1 mr-3 h-6 w-6`; + */ - // if(Navigation.isOnThisPage(props.link.to)){ - // iconClassName = `text-emerald-500 flex-shrink-0 -ml-1 mr-3 h-6 w-6`; - // } - // } - // } + /* + * if(Navigation.isOnThisPage(props.link.to)){ + * iconClassName = `text-emerald-500 flex-shrink-0 -ml-1 mr-3 h-6 w-6`; + * } + * } + * } + */ return ( <> diff --git a/Common/UI/Utils/API/API.ts b/Common/UI/Utils/API/API.ts index 9e12b92e67..29753b0642 100644 --- a/Common/UI/Utils/API/API.ts +++ b/Common/UI/Utils/API/API.ts @@ -98,9 +98,11 @@ class BaseAPI extends API { public static override handleError( error: HTTPErrorResponse | APIException, ): HTTPErrorResponse | APIException { - // 405 Status - Tenant not found. If Project was deleted. - // 401 Status - User is not logged in. - // 403 Status - Forbidden. If the IP address is not whitelisted (for example). + /* + * 405 Status - Tenant not found. If Project was deleted. + * 401 Status - User is not logged in. + * 403 Status - Forbidden. If the IP address is not whitelisted (for example). + */ if ( error instanceof HTTPErrorResponse && (error.statusCode === 401 || error.statusCode === 405) diff --git a/Common/UI/Utils/Countries.ts b/Common/UI/Utils/Countries.ts index 0de80cee65..6295085de5 100644 --- a/Common/UI/Utils/Countries.ts +++ b/Common/UI/Utils/Countries.ts @@ -1,6 +1,8 @@ -// ISO 3166-1 alpha-2 country codes and names. -// Limited to widely recognized sovereign states and territories supported by Stripe. -// If needed, expand or adjust for specific business logic. +/* + * ISO 3166-1 alpha-2 country codes and names. + * Limited to widely recognized sovereign states and territories supported by Stripe. + * If needed, expand or adjust for specific business logic. + */ export interface CountryOption { value: string; label: string; diff --git a/Common/Utils/Schema/ModelSchema.ts b/Common/Utils/Schema/ModelSchema.ts index 28a90473a2..7c4ebd3322 100644 --- a/Common/Utils/Schema/ModelSchema.ts +++ b/Common/Utils/Schema/ModelSchema.ts @@ -1157,8 +1157,10 @@ export class ModelSchema extends BaseSchema { data.disableOpenApiSchema || false, ); - // Check if the column is required and make it optional if not - // Also make columns with default values optional in create schemas + /* + * Check if the column is required and make it optional if not + * Also make columns with default values optional in create schemas + */ if (column.isDefaultValueColumn) { // should be optional zodType = zodType.optional(); diff --git a/Copilot/Service/CopilotActions/AddSpan.ts b/Copilot/Service/CopilotActions/AddSpan.ts index bef69b025c..cef4717a67 100644 --- a/Copilot/Service/CopilotActions/AddSpan.ts +++ b/Copilot/Service/CopilotActions/AddSpan.ts @@ -339,8 +339,10 @@ export default class AddSpans extends CopilotActionBase { _data: CopilotProcess, inputCode: string, ): Promise { - // const fileLanguage: TechStack = data.input.files[data.input.currentFilePath] - // ?.fileLanguage as TechStack; + /* + * const fileLanguage: TechStack = data.input.files[data.input.currentFilePath] + * ?.fileLanguage as TechStack; + */ const fileLanguage: TechStack = TechStack.TypeScript; @@ -383,11 +385,13 @@ export default class AddSpans extends CopilotActionBase { inputCode: string; outputCode: string; }): Promise { - // this code contains text as well. The code is in betwen ``` and ```. Please extract the code and return it. - // for example code can be in the format of - // ```python - // print("Hello World") - // ``` + /* + * this code contains text as well. The code is in betwen ``` and ```. Please extract the code and return it. + * for example code can be in the format of + * ```python + * print("Hello World") + * ``` + */ // so the code to be extracted is print("Hello World") diff --git a/Copilot/Service/CopilotActions/CopilotActionsBase.ts b/Copilot/Service/CopilotActions/CopilotActionsBase.ts index 13bf79b79b..83a23b49e2 100644 --- a/Copilot/Service/CopilotActions/CopilotActionsBase.ts +++ b/Copilot/Service/CopilotActions/CopilotActionsBase.ts @@ -168,8 +168,10 @@ If you have any feedback or suggestions, please let us know. We would love to h while (!isActionComplete) { if (!(await this.validateExecutionStep(processData))) { - // execution step not valid - // return data as it is + /* + * execution step not valid + * return data as it is + */ return processData; } diff --git a/Copilot/Service/CopilotActions/ImproveComments.ts b/Copilot/Service/CopilotActions/ImproveComments.ts index 65e3e22d88..6de8d1faac 100644 --- a/Copilot/Service/CopilotActions/ImproveComments.ts +++ b/Copilot/Service/CopilotActions/ImproveComments.ts @@ -358,8 +358,10 @@ export default class ImproveComments extends CopilotActionBase { _data: CopilotProcess, inputCode: string, ): Promise { - // const fileLanguage: TechStack = data.input.files[data.input.currentFilePath] - // ?.fileLanguage as TechStack; + /* + * const fileLanguage: TechStack = data.input.files[data.input.currentFilePath] + * ?.fileLanguage as TechStack; + */ const fileLanguage: TechStack = TechStack.TypeScript; @@ -402,11 +404,13 @@ export default class ImproveComments extends CopilotActionBase { inputCode: string; outputCode: string; }): Promise { - // this code contains text as well. The code is in betwen ``` and ```. Please extract the code and return it. - // for example code can be in the format of - // ```python - // print("Hello World") - // ``` + /* + * this code contains text as well. The code is in betwen ``` and ```. Please extract the code and return it. + * for example code can be in the format of + * ```python + * print("Hello World") + * ``` + */ // so the code to be extracted is print("Hello World") diff --git a/Dashboard/src/Components/Dashboard/Canvas/ComponentSettingsSideOver.tsx b/Dashboard/src/Components/Dashboard/Canvas/ComponentSettingsSideOver.tsx index 71479fcde3..31505a7ceb 100644 --- a/Dashboard/src/Components/Dashboard/Canvas/ComponentSettingsSideOver.tsx +++ b/Dashboard/src/Components/Dashboard/Canvas/ComponentSettingsSideOver.tsx @@ -36,9 +36,11 @@ const ComponentSettingsSideOver: FunctionComponent = ( }, ) as DashboardBaseComponent; - // const [hasFormValidationErrors, setHasFormValidationErrors] = useState< - // Dictionary - // >({}); + /* + * const [hasFormValidationErrors, setHasFormValidationErrors] = useState< + * Dictionary + * >({}); + */ const [showDeleteConfirmation, setShowDeleteConfirmation] = useState(false); @@ -84,9 +86,11 @@ const ComponentSettingsSideOver: FunctionComponent = ( ) => { - // setHasFormValidationErrors(values); - // }} + /* + * onHasFormValidationErrors={(values: Dictionary) => { + * setHasFormValidationErrors(values); + * }} + */ onFormChange={(component: DashboardBaseComponent) => { props.onComponentUpdate(component); }} diff --git a/Dashboard/src/Components/Form/Monitor/MonitorCriteriaAlertsForm.tsx b/Dashboard/src/Components/Form/Monitor/MonitorCriteriaAlertsForm.tsx index 4dbd6461da..f29969c645 100644 --- a/Dashboard/src/Components/Form/Monitor/MonitorCriteriaAlertsForm.tsx +++ b/Dashboard/src/Components/Form/Monitor/MonitorCriteriaAlertsForm.tsx @@ -42,15 +42,17 @@ const MonitorCriteriaAlertsForm: FunctionComponent = ( alertSeverityDropdownOptions={props.alertSeverityDropdownOptions} onCallPolicyDropdownOptions={props.onCallPolicyDropdownOptions} initialValue={i} - // onDelete={() => { - // // remove the criteria filter - // const index: number = alerts.indexOf(i); - // const newAlerts: Array = [ - // ...alerts, - // ]; - // newAlerts.splice(index, 1); - // setAlerts(newAlerts); - // }} + /* + * onDelete={() => { + * // remove the criteria filter + * const index: number = alerts.indexOf(i); + * const newAlerts: Array = [ + * ...alerts, + * ]; + * newAlerts.splice(index, 1); + * setAlerts(newAlerts); + * }} + */ onChange={(value: CriteriaAlert) => { const index: number = alerts.indexOf(i); const newAlerts: Array = [...alerts]; diff --git a/Dashboard/src/Components/Form/Monitor/MonitorCriteriaIncidentsForm.tsx b/Dashboard/src/Components/Form/Monitor/MonitorCriteriaIncidentsForm.tsx index 1574693501..c5dd49dd38 100644 --- a/Dashboard/src/Components/Form/Monitor/MonitorCriteriaIncidentsForm.tsx +++ b/Dashboard/src/Components/Form/Monitor/MonitorCriteriaIncidentsForm.tsx @@ -42,15 +42,17 @@ const MonitorCriteriaIncidentsForm: FunctionComponent = ( } onCallPolicyDropdownOptions={props.onCallPolicyDropdownOptions} initialValue={i} - // onDelete={() => { - // // remove the criteria filter - // const index: number = incidents.indexOf(i); - // const newIncidents: Array = [ - // ...incidents, - // ]; - // newIncidents.splice(index, 1); - // setIncidents(newIncidents); - // }} + /* + * onDelete={() => { + * // remove the criteria filter + * const index: number = incidents.indexOf(i); + * const newIncidents: Array = [ + * ...incidents, + * ]; + * newIncidents.splice(index, 1); + * setIncidents(newIncidents); + * }} + */ onChange={(value: CriteriaIncident) => { const index: number = incidents.indexOf(i); const newIncidents: Array = [...incidents]; diff --git a/Dashboard/src/Components/Form/Monitor/MonitorSteps.tsx b/Dashboard/src/Components/Form/Monitor/MonitorSteps.tsx index a488fd85c1..9f1837c3c3 100644 --- a/Dashboard/src/Components/Form/Monitor/MonitorSteps.tsx +++ b/Dashboard/src/Components/Form/Monitor/MonitorSteps.tsx @@ -236,31 +236,35 @@ const MonitorStepsElement: FunctionComponent = ( onCallPolicyDropdownOptions={onCallPolicyDropdownOptions} value={i} probes={probes} - // onDelete={() => { - // // remove the criteria filter - // const index: number | undefined = - // monitorSteps.data?.monitorStepsInstanceArray.findIndex((item: MonitorStep) => { - // return item.data?.id === value.data?.id; - // }) + /* + * onDelete={() => { + * // remove the criteria filter + * const index: number | undefined = + * monitorSteps.data?.monitorStepsInstanceArray.findIndex((item: MonitorStep) => { + * return item.data?.id === value.data?.id; + * }) + */ - // if (index === undefined) { - // return; - // } - // const newMonitorSteps: Array = [ - // ...(monitorSteps.data - // ?.monitorStepsInstanceArray || []), - // ]; - // newMonitorSteps.splice(index, 1); - // setMonitorSteps( - // new MonitorSteps().fromJSON({ - // _type: 'MonitorSteps', - // value: { - // monitorStepsInstanceArray: - // newMonitorSteps, - // }, - // }) - // ); - // }} + /* + * if (index === undefined) { + * return; + * } + * const newMonitorSteps: Array = [ + * ...(monitorSteps.data + * ?.monitorStepsInstanceArray || []), + * ]; + * newMonitorSteps.splice(index, 1); + * setMonitorSteps( + * new MonitorSteps().fromJSON({ + * _type: 'MonitorSteps', + * value: { + * monitorStepsInstanceArray: + * newMonitorSteps, + * }, + * }) + * ); + * }} + */ onChange={(value: MonitorStep) => { const index: number | undefined = monitorSteps.data?.monitorStepsInstanceArray.findIndex( diff --git a/Dashboard/src/Components/Header/Header.tsx b/Dashboard/src/Components/Header/Header.tsx index 516ff81270..c732820f08 100644 --- a/Dashboard/src/Components/Header/Header.tsx +++ b/Dashboard/src/Components/Header/Header.tsx @@ -1,7 +1,9 @@ import PageMap from "../../Utils/PageMap"; import RouteMap, { RouteUtil } from "../../Utils/RouteMap"; -// import SearchBox from './SearchBox'; -// import Notifications from './Notifications'; +/* + * import SearchBox from './SearchBox'; + * import Notifications from './Notifications'; + */ import Help from "./Help"; import Logo from "./Logo"; import ProjectPicker from "./ProjectPicker"; diff --git a/Dashboard/src/Components/OnCallPolicy/TimeLog/OnCallDutyTimeLogTable.tsx b/Dashboard/src/Components/OnCallPolicy/TimeLog/OnCallDutyTimeLogTable.tsx index 99680e3c84..a6b7d59ff4 100644 --- a/Dashboard/src/Components/OnCallPolicy/TimeLog/OnCallDutyTimeLogTable.tsx +++ b/Dashboard/src/Components/OnCallPolicy/TimeLog/OnCallDutyTimeLogTable.tsx @@ -151,16 +151,20 @@ const OnCallPolicyLogTable: FunctionComponent = ( let startDate: Date = log.startsAt!; let endDate: Date = log.endsAt || OneUptimeDate.getCurrentDate(); - // if end date is mroe than the end date selected in the range, then - // set the end date to the end date selected in the range + /* + * if end date is mroe than the end date selected in the range, then + * set the end date to the end date selected in the range + */ if ( OneUptimeDate.isAfter(endDate, pickedStartAndEndDate.endValue) ) { endDate = pickedStartAndEndDate.endValue; } - // if start date is less than the start date selected in the range, then - // set the start date to the start date selected in the range + /* + * if start date is less than the start date selected in the range, then + * set the start date to the start date selected in the range + */ if ( OneUptimeDate.isBefore( diff --git a/Dashboard/src/Components/Traces/TraceExplorer.tsx b/Dashboard/src/Components/Traces/TraceExplorer.tsx index 786382f499..657df524c8 100644 --- a/Dashboard/src/Components/Traces/TraceExplorer.tsx +++ b/Dashboard/src/Components/Traces/TraceExplorer.tsx @@ -388,8 +388,10 @@ const TraceExplorer: FunctionComponent = ( }); }, []); - // Derived values for summary / filtering - // Services involved in this trace only + /* + * Derived values for summary / filtering + * Services involved in this trace only + */ const servicesInTrace: TelemetryService[] = React.useMemo(() => { if (spans.length === 0) { return []; @@ -552,9 +554,11 @@ const TraceExplorer: FunctionComponent = ( const numberOfDigitsInIntervalTemp: number = intervalTemp.toString().length; const interval: number = Math.pow(10, numberOfDigitsInIntervalTemp); - // Improved root span detection: - // 1. Root if parentSpanId is null/undefined/empty string. - // 2. Root if parentSpanId does not exist among spanIds (orphan) – common when trace is truncated. + /* + * Improved root span detection: + * 1. Root if parentSpanId is null/undefined/empty string. + * 2. Root if parentSpanId does not exist among spanIds (orphan) – common when trace is truncated. + */ const allSpanIds: Set = new Set( displaySpans .map((s: Span) => { @@ -591,9 +595,11 @@ const TraceExplorer: FunctionComponent = ( }, ); - // Fallback: If after building hierarchy we only have 1 row but many spans, the - // hierarchy likely failed (e.g., every span references a missing parent in a chain) - // or produced an unhelpful single path. Display a flat list so user can still see all. + /* + * Fallback: If after building hierarchy we only have 1 row but many spans, the + * hierarchy likely failed (e.g., every span references a missing parent in a chain) + * or produced an unhelpful single path. Display a flat list so user can still see all. + */ if (allRows.length === 1 && displaySpans.length > 10) { allRows = displaySpans.map((span: Span) => { const telemetryService: TelemetryService | undefined = diff --git a/Dashboard/src/Pages/AICopilot/CodeRepository/View/Documentation.tsx b/Dashboard/src/Pages/AICopilot/CodeRepository/View/Documentation.tsx index d2f6d233b6..d938364740 100644 --- a/Dashboard/src/Pages/AICopilot/CodeRepository/View/Documentation.tsx +++ b/Dashboard/src/Pages/AICopilot/CodeRepository/View/Documentation.tsx @@ -60,8 +60,10 @@ const CopilotDocuementationPage: FunctionComponent< return; } - // Send api request to get documentation - // http://localhost/docs/copilot/introduction + /* + * Send api request to get documentation + * http://localhost/docs/copilot/introduction + */ const documentation: HTTPErrorResponse | HTTPResponse = (await API.get({ diff --git a/Dashboard/src/Pages/Settings/BillingPaymentMethodForm.tsx b/Dashboard/src/Pages/Settings/BillingPaymentMethodForm.tsx index 98520b9037..24e8b1b9de 100644 --- a/Dashboard/src/Pages/Settings/BillingPaymentMethodForm.tsx +++ b/Dashboard/src/Pages/Settings/BillingPaymentMethodForm.tsx @@ -24,13 +24,17 @@ const CheckoutForm: FunctionComponent = ( event: Event, ): Promise => { event.preventDefault(); - // We don't want to let default form submission happen here, - // which would refresh the page. + /* + * We don't want to let default form submission happen here, + * which would refresh the page. + */ event.preventDefault(); if (!stripe || !elements) { - // Stripe.js has not yet loaded. - // Make sure to disable form submission until Stripe.js has loaded. + /* + * Stripe.js has not yet loaded. + * Make sure to disable form submission until Stripe.js has loaded. + */ return; } @@ -43,18 +47,22 @@ const CheckoutForm: FunctionComponent = ( }); if (error) { - // This point will only be reached if there is an immediate error when - // confirming the payment. Show error to your customer (for example, payment - // details incomplete) + /* + * This point will only be reached if there is an immediate error when + * confirming the payment. Show error to your customer (for example, payment + * details incomplete) + */ props.onError( error.message?.toString() || "Unknown error with your payemnt provider.", ); } else { - // Your customer will be redirected to your `return_url`. For some payment - // methods like iDEAL, your customer will be redirected to an indeterminate - // site first to authorize the payment, then redirected to the `return_url`. + /* + * Your customer will be redirected to your `return_url`. For some payment + * methods like iDEAL, your customer will be redirected to an indeterminate + * site first to authorize the payment, then redirected to the `return_url`. + */ props.onSuccess(); } }; diff --git a/Dashboard/src/Pages/Settings/ScheduledMaintenanceTemplates.tsx b/Dashboard/src/Pages/Settings/ScheduledMaintenanceTemplates.tsx index f1f81388b4..42bf99eae4 100644 --- a/Dashboard/src/Pages/Settings/ScheduledMaintenanceTemplates.tsx +++ b/Dashboard/src/Pages/Settings/ScheduledMaintenanceTemplates.tsx @@ -28,8 +28,10 @@ type GetTemplateFormFieldsFunction = (data: { export const getTemplateFormFields: GetTemplateFormFieldsFunction = (data: { isViewPage: boolean; }): ModelField[] => { - // if its the view page then ignore the owner fields - // because they are already on the table in the view page. + /* + * if its the view page then ignore the owner fields + * because they are already on the table in the view page. + */ let fields: ModelField[] = [ { @@ -345,8 +347,10 @@ type GetFormStepsFunction = (data: { export const getFormSteps: GetFormStepsFunction = (data: { isViewPage: boolean; }): Array> => { - // if its the view page then ignore the owner fields - // because they are already on the table in the view page. + /* + * if its the view page then ignore the owner fields + * because they are already on the table in the view page. + */ const steps: Array> = [ { diff --git a/E2E/playwright.config.ts b/E2E/playwright.config.ts index 43060f142e..275ded2a38 100644 --- a/E2E/playwright.config.ts +++ b/E2E/playwright.config.ts @@ -54,32 +54,38 @@ export default defineConfig({ use: { ...devices["Desktop Firefox"] }, }, /* Test against mobile viewports. */ - // { - // name: 'Mobile Chrome', - // use: { ...devices['Pixel 5'] }, - // }, - // { - // name: 'Mobile Safari', - // use: { ...devices['iPhone 12'] }, - // }, + /* + * { + * name: 'Mobile Chrome', + * use: { ...devices['Pixel 5'] }, + * }, + * { + * name: 'Mobile Safari', + * use: { ...devices['iPhone 12'] }, + * }, + */ /* Test against branded browsers. */ - // { - // name: 'Microsoft Edge', - // use: { channel: 'msedge' }, - // }, - // { - // name: 'Google Chrome', - // use: { channel: 'chrome' }, - // }, + /* + * { + * name: 'Microsoft Edge', + * use: { channel: 'msedge' }, + * }, + * { + * name: 'Google Chrome', + * use: { channel: 'chrome' }, + * }, + */ ], /* Folder for test artifacts such as screenshots, videos, traces, etc. */ // outputDir: 'test-results/', /* Run your local dev server before starting the tests */ - // webServer: { - // command: 'npm run start', - // port: 3000, - // }, + /* + * webServer: { + * command: 'npm run start', + * port: 3000, + * }, + */ }); diff --git a/Home/API/BlogAPI.ts b/Home/API/BlogAPI.ts index 459e255025..1e72d5c7d2 100644 --- a/Home/API/BlogAPI.ts +++ b/Home/API/BlogAPI.ts @@ -67,8 +67,10 @@ app.get( app.get( "/blog/post/:postName/:fileName", async (req: ExpressRequest, res: ExpressResponse) => { - // return static files for blog post images - // the static files are stored in the /usr/src/blog/post/:file/:imageName + /* + * return static files for blog post images + * the static files are stored in the /usr/src/blog/post/:file/:imageName + */ try { const fileName: string = req.params["fileName"] as string; diff --git a/Home/Routes.ts b/Home/Routes.ts index 6c226bca37..9be68baa00 100755 --- a/Home/Routes.ts +++ b/Home/Routes.ts @@ -32,8 +32,10 @@ const HomeFeatureSet: FeatureSet = { init: async (): Promise => { const app: ExpressApplication = Express.getExpressApp(); - //Routes - // Middleware to inject baseUrl for templates (used for canonical links) + /* + * Routes + * Middleware to inject baseUrl for templates (used for canonical links) + */ app.use( async (_req: ExpressRequest, res: ExpressResponse, next: () => void) => { if (!res.locals["homeUrl"]) { @@ -1406,8 +1408,10 @@ const HomeFeatureSet: FeatureSet = { "# Disallowed because host is not oneuptime.com", ].join("\n"); } else { - // Allow all and point to sitemap - // res.locals.homeUrl is set earlier middleware; fallback to canonical domain. + /* + * Allow all and point to sitemap + * res.locals.homeUrl is set earlier middleware; fallback to canonical domain. + */ const homeUrl: string = ( res.locals["homeUrl"] || "https://oneuptime.com" ).replace(/\/$/, ""); diff --git a/IncomingRequestIngest/Jobs/IncomingRequestIngest/ProcessIncomingRequestIngest.ts b/IncomingRequestIngest/Jobs/IncomingRequestIngest/ProcessIncomingRequestIngest.ts index c72ab78ca6..1846caafb2 100644 --- a/IncomingRequestIngest/Jobs/IncomingRequestIngest/ProcessIncomingRequestIngest.ts +++ b/IncomingRequestIngest/Jobs/IncomingRequestIngest/ProcessIncomingRequestIngest.ts @@ -32,9 +32,11 @@ QueueWorker.getWorker( `Successfully processed incoming request ingestion job: ${job.name}`, ); } catch (error) { - // Certain BadDataException cases are expected / non-actionable and should not fail the job. - // These include disabled monitors (manual, maintenance, explicitly disabled) and missing monitors - // (e.g. secret key referencing a deleted monitor). Retrying provides no value and only creates noise. + /* + * Certain BadDataException cases are expected / non-actionable and should not fail the job. + * These include disabled monitors (manual, maintenance, explicitly disabled) and missing monitors + * (e.g. secret key referencing a deleted monitor). Retrying provides no value and only creates noise. + */ if ( error instanceof BadDataException && (error.message === ExceptionMessages.MonitorNotFound || diff --git a/MCP/Services/OneUptimeApiService.ts b/MCP/Services/OneUptimeApiService.ts index ea963ed94e..d4ae985453 100644 --- a/MCP/Services/OneUptimeApiService.ts +++ b/MCP/Services/OneUptimeApiService.ts @@ -318,10 +318,12 @@ export default class OneUptimeApiService { for (const columnName of columnNames) { const accessControl: any = accessControlForColumns[columnName]; - // Include the field if: - // 1. No access control defined (open access) - // 2. Has read permissions that are not empty - // 3. Read permissions don't only contain Permission.CurrentUser + /* + * Include the field if: + * 1. No access control defined (open access) + * 2. Has read permissions that are not empty + * 3. Read permissions don't only contain Permission.CurrentUser + */ if ( !accessControl || (accessControl.read && diff --git a/MCP/Utils/DynamicToolGenerator.ts b/MCP/Utils/DynamicToolGenerator.ts index 76c4b8ec6a..7cd7344985 100644 --- a/MCP/Utils/DynamicToolGenerator.ts +++ b/MCP/Utils/DynamicToolGenerator.ts @@ -43,8 +43,10 @@ export default class DynamicToolGenerator { zodSchema: ModelSchemaType | AnalyticsModelSchemaType, ): any { try { - // The Zod schemas in this project are extended with OpenAPI metadata - // We can extract the shape and create a basic JSON schema + /* + * The Zod schemas in this project are extended with OpenAPI metadata + * We can extract the shape and create a basic JSON schema + */ const shape: any = (zodSchema as any)._def?.shape; if (!shape) { diff --git a/MCP/__tests__/DynamicToolGenerator.test.ts b/MCP/__tests__/DynamicToolGenerator.test.ts index 946c411eec..2a492195a1 100644 --- a/MCP/__tests__/DynamicToolGenerator.test.ts +++ b/MCP/__tests__/DynamicToolGenerator.test.ts @@ -32,8 +32,10 @@ describe("DynamicToolGenerator", () => { testCases.forEach( ({ input, expected }: { input: string; expected: string }) => { - // Since sanitizeToolName is private, we test it through the public API - // or we could expose it for testing purposes + /* + * Since sanitizeToolName is private, we test it through the public API + * or we could expose it for testing purposes + */ const sanitized: string = input .replace(/([a-z])([A-Z])/g, "$1_$2") .toLowerCase() @@ -120,8 +122,10 @@ describe("DynamicToolGenerator", () => { describe("Schema Conversion", () => { it("should handle Zod schema to JSON schema conversion", () => { - // This test validates that schema conversion would work - // Mock Zod schema structure + /* + * This test validates that schema conversion would work + * Mock Zod schema structure + */ const mockZodSchema: Record = { _def: { shape: { diff --git a/MCP/__tests__/OneUptimeApiService.test.ts b/MCP/__tests__/OneUptimeApiService.test.ts index 94b88b3072..d918ce99cf 100644 --- a/MCP/__tests__/OneUptimeApiService.test.ts +++ b/MCP/__tests__/OneUptimeApiService.test.ts @@ -297,8 +297,10 @@ describe("OneUptimeApiService", () => { args: any; expectedData: any; }) => { - // Test the internal getRequestData method if it were public - // This would require exposing the method or testing through executeOperation + /* + * Test the internal getRequestData method if it were public + * This would require exposing the method or testing through executeOperation + */ expect(testCase.expectedData).toBeDefined(); }, ); @@ -311,8 +313,10 @@ describe("OneUptimeApiService", () => { }); it("should include proper authentication headers", () => { - // Test that headers include the API key - // This would require exposing the getHeaders method or testing through executeOperation + /* + * Test that headers include the API key + * This would require exposing the getHeaders method or testing through executeOperation + */ expect(mockConfig.apiKey).toBe("test-api-key-123"); }); }); diff --git a/OpenTelemetryIngest/Config.ts b/OpenTelemetryIngest/Config.ts index cb870da94d..d18bcdce87 100644 --- a/OpenTelemetryIngest/Config.ts +++ b/OpenTelemetryIngest/Config.ts @@ -8,8 +8,10 @@ if (typeof concurrency === "string") { export const OPEN_TELEMETRY_INGEST_CONCURRENCY: number = concurrency as number; -// Some telemetry batches can be large and take >30s (BullMQ default lock) to process. -// Allow configuring a longer lock duration (in ms) to avoid premature stall detection. +/* + * Some telemetry batches can be large and take >30s (BullMQ default lock) to process. + * Allow configuring a longer lock duration (in ms) to avoid premature stall detection. + */ // 10 minutes. export const OPEN_TELEMETRY_INGEST_LOCK_DURATION_MS: number = 10 * 60 * 1000; diff --git a/OpenTelemetryIngest/Services/OtelIngest.ts b/OpenTelemetryIngest/Services/OtelIngest.ts index 5a6ebbce44..3befae8bc7 100644 --- a/OpenTelemetryIngest/Services/OtelIngest.ts +++ b/OpenTelemetryIngest/Services/OtelIngest.ts @@ -126,8 +126,10 @@ export default class OtelIngestService { @CaptureSpan() public static async processLogsFromQueue(req: ExpressRequest): Promise { - // This method is specifically for queue processing - // It bypasses the response handling since the response was already sent + /* + * This method is specifically for queue processing + * It bypasses the response handling since the response was already sent + */ await this.processLogsAsync(req); } @@ -135,8 +137,10 @@ export default class OtelIngestService { public static async processTracesFromQueue( req: ExpressRequest, ): Promise { - // This method is specifically for queue processing - // It bypasses the response handling since the response was already sent + /* + * This method is specifically for queue processing + * It bypasses the response handling since the response was already sent + */ await this.processTracesAsync(req); } @@ -144,8 +148,10 @@ export default class OtelIngestService { public static async processMetricsFromQueue( req: ExpressRequest, ): Promise { - // This method is specifically for queue processing - // It bypasses the response handling since the response was already sent + /* + * This method is specifically for queue processing + * It bypasses the response handling since the response was already sent + */ await this.processMetricsAsync(req); } @@ -519,8 +525,10 @@ export default class OtelIngestService { const attributeKeySet: Set = new Set(); const serviceDictionary: Dictionary = {}; - // Metric name to serviceId map - // example: "cpu.usage" -> [serviceId1, serviceId2] + /* + * Metric name to serviceId map + * example: "cpu.usage" -> [serviceId1, serviceId2] + */ const metricNameServiceNameMap: Dictionary = {}; let resourceMetricCounter: number = 0; @@ -1292,8 +1300,10 @@ export default class OtelIngestService { // add exception to dbExceptions dbExceptions.push(exception); - // save exception status - // Fix: Await the async operation to prevent memory leaks from unhandled promises + /* + * save exception status + * Fix: Await the async operation to prevent memory leaks from unhandled promises + */ ExceptionUtil.saveOrUpdateTelemetryException(exception).catch( (err: Error) => { logger.error("Error saving/updating telemetry exception:"); diff --git a/Probe/Config.ts b/Probe/Config.ts index e48b544348..325e8958e8 100644 --- a/Probe/Config.ts +++ b/Probe/Config.ts @@ -85,17 +85,21 @@ export const PORT: Port = new Port( process.env["PORT"] ? parseInt(process.env["PORT"]) : 3874, ); -// Proxy configuration for all HTTP/HTTPS requests made by the probe -// HTTP_PROXY_URL: Proxy for HTTP requests -// Format: http://[username:password@]proxy.example.com:port -// Example: http://proxy.example.com:8080 -// Example with auth: http://user:pass@proxy.example.com:8080 +/* + * Proxy configuration for all HTTP/HTTPS requests made by the probe + * HTTP_PROXY_URL: Proxy for HTTP requests + * Format: http://[username:password@]proxy.example.com:port + * Example: http://proxy.example.com:8080 + * Example with auth: http://user:pass@proxy.example.com:8080 + */ export const HTTP_PROXY_URL: string | null = process.env["HTTP_PROXY_URL"] || process.env["http_proxy"] || null; -// HTTPS_PROXY_URL: Proxy for HTTPS requests -// Format: http://[username:password@]proxy.example.com:port -// Example: http://proxy.example.com:8080 -// Example with auth: http://user:pass@proxy.example.com:8080 +/* + * HTTPS_PROXY_URL: Proxy for HTTPS requests + * Format: http://[username:password@]proxy.example.com:port + * Example: http://proxy.example.com:8080 + * Example with auth: http://user:pass@proxy.example.com:8080 + */ export const HTTPS_PROXY_URL: string | null = process.env["HTTPS_PROXY_URL"] || process.env["https_proxy"] || null; diff --git a/Probe/Utils/Monitors/MonitorTypes/PortMonitor.ts b/Probe/Utils/Monitors/MonitorTypes/PortMonitor.ts index 209b4e1a36..936b144063 100644 --- a/Probe/Utils/Monitors/MonitorTypes/PortMonitor.ts +++ b/Probe/Utils/Monitors/MonitorTypes/PortMonitor.ts @@ -117,8 +117,10 @@ export default class PortMonitor { logger.debug("Ping timeout"); if (!hasPromiseResolved) { - // this could mean port 25 is blocked by the cloud provider and is timing out but is actually online. - // so we will return isOnline as true + /* + * this could mean port 25 is blocked by the cloud provider and is timing out but is actually online. + * so we will return isOnline as true + */ if ( !Register.isPingMonitoringEnabled() && port.toNumber() === 25 diff --git a/Probe/Utils/Monitors/MonitorTypes/SyntheticMonitor.ts b/Probe/Utils/Monitors/MonitorTypes/SyntheticMonitor.ts index 5b805d909e..112d33d653 100644 --- a/Probe/Utils/Monitors/MonitorTypes/SyntheticMonitor.ts +++ b/Probe/Utils/Monitors/MonitorTypes/SyntheticMonitor.ts @@ -337,10 +337,12 @@ export default class SyntheticMonitor { page = await browser.newPage(); } - // if (data.browserType === BrowserType.Webkit) { - // browser = await webkit.launch(); - // page = await browser.newPage(); - // } + /* + * if (data.browserType === BrowserType.Webkit) { + * browser = await webkit.launch(); + * page = await browser.newPage(); + * } + */ await page?.setViewportSize({ width: viewport.width, diff --git a/Probe/Utils/OnlineCheck.ts b/Probe/Utils/OnlineCheck.ts index 613af2c1df..6f086cae46 100644 --- a/Probe/Utils/OnlineCheck.ts +++ b/Probe/Utils/OnlineCheck.ts @@ -10,8 +10,10 @@ export default class OnlineCheck { // burn domain names into the code to see if this probe is online. public static async canProbeMonitorWebsiteMonitors(): Promise { if (!IsBillingEnabled) { - // if the billing is not enabled which means its non on SaaS but self-hosted. - // in this case return true as we don't need to check for online status. + /* + * if the billing is not enabled which means its non on SaaS but self-hosted. + * in this case return true as we don't need to check for online status. + */ return true; } @@ -40,8 +42,10 @@ export default class OnlineCheck { public static async canProbeMonitorPingMonitors(): Promise { if (!IsBillingEnabled) { - // if the billing is not enabled which means its non on SaaS but self-hosted. - // in this case return true as we don't need to check for online status. + /* + * if the billing is not enabled which means its non on SaaS but self-hosted. + * in this case return true as we don't need to check for online status. + */ return true; } @@ -70,8 +74,10 @@ export default class OnlineCheck { public static async canProbeMonitorPortMonitors(): Promise { if (!IsBillingEnabled) { - // if the billing is not enabled which means its non on SaaS but self-hosted. - // in this case return true as we don't need to check for online status. + /* + * if the billing is not enabled which means its non on SaaS but self-hosted. + * in this case return true as we don't need to check for online status. + */ return true; } diff --git a/ProbeIngest/API/Monitor.ts b/ProbeIngest/API/Monitor.ts index 2ee6eac736..85279de752 100644 --- a/ProbeIngest/API/Monitor.ts +++ b/ProbeIngest/API/Monitor.ts @@ -324,10 +324,12 @@ router.post( logger.debug("Fetching monitor list for probes"); - // we do this to distribute the load among the probes. - // so every request will get a different set of monitors to monitor - // const moduloBy: number = 10; - // const reminder: number = NumberUtil.getRandomNumber(0, 100) % moduloBy; + /* + * we do this to distribute the load among the probes. + * so every request will get a different set of monitors to monitor + * const moduloBy: number = 10; + * const reminder: number = NumberUtil.getRandomNumber(0, 100) % moduloBy; + */ const count: PositiveNumber = await MonitorProbeService.countBy({ query: { @@ -340,8 +342,10 @@ router.post( }, }); - // we do this to distribute the load among the probes. - // so every request will get a different set of monitors to monitor + /* + * we do this to distribute the load among the probes. + * so every request will get a different set of monitors to monitor + */ const countNumber: number = count.toNumber(); let skip: number = 0; diff --git a/ProbeIngest/API/Probe.ts b/ProbeIngest/API/Probe.ts index c992d822b8..706c186aa4 100644 --- a/ProbeIngest/API/Probe.ts +++ b/ProbeIngest/API/Probe.ts @@ -119,8 +119,10 @@ router.post( ); } - // If global probe offline? If yes, then email master-admin. - // If not a global probe then them email project owners. + /* + * If global probe offline? If yes, then email master-admin. + * If not a global probe then them email project owners. + */ const isGlobalProbe: boolean = !probe.projectId; const emailsToNotify: Email[] = []; @@ -210,8 +212,10 @@ router.post( issue += " This probe cannot reach out to monitor ports."; } - // now send an email to all the emailsToNotify - // Skip sending email if billing is enabled + /* + * now send an email to all the emailsToNotify + * Skip sending email if billing is enabled + */ if (!IsBillingEnabled) { for (const email of emailsToNotify) { MailService.sendMail( @@ -394,8 +398,10 @@ router.post( next: NextFunction, ): Promise => { try { - // This endpoint returns the number of monitors pending for the specific probe - // to be used by Keda for autoscaling probe replicas + /* + * This endpoint returns the number of monitors pending for the specific probe + * to be used by Keda for autoscaling probe replicas + */ // Get the probe ID from the authenticated request const data: JSONObject = req.body; diff --git a/ProbeIngest/Jobs/ProbeIngest/ProcessProbeIngest.ts b/ProbeIngest/Jobs/ProbeIngest/ProcessProbeIngest.ts index 3c60bd4598..aaf3f7b103 100644 --- a/ProbeIngest/Jobs/ProbeIngest/ProcessProbeIngest.ts +++ b/ProbeIngest/Jobs/ProbeIngest/ProcessProbeIngest.ts @@ -26,9 +26,11 @@ QueueWorker.getWorker( logger.debug(`Successfully processed probe ingestion job: ${job.name}`); } catch (error) { - // Certain BadDataException cases are expected / non-actionable and should not fail the job. - // These include disabled monitors (manual, maintenance, explicitly disabled) and missing monitors - // (e.g. secret key referencing a deleted monitor). Retrying provides no value and only creates noise. + /* + * Certain BadDataException cases are expected / non-actionable and should not fail the job. + * These include disabled monitors (manual, maintenance, explicitly disabled) and missing monitors + * (e.g. secret key referencing a deleted monitor). Retrying provides no value and only creates noise. + */ if ( error instanceof BadDataException && (error.message === ExceptionMessages.MonitorNotFound || diff --git a/Scripts/PaymentProvider/CouponCodeGenerator.ts b/Scripts/PaymentProvider/CouponCodeGenerator.ts index ff1adce745..164f390bd2 100644 --- a/Scripts/PaymentProvider/CouponCodeGenerator.ts +++ b/Scripts/PaymentProvider/CouponCodeGenerator.ts @@ -1,5 +1,7 @@ -// To run this script: -// export $(grep -v '^#' config.env | xargs) && ts-node ./Scripts/PaymentProvider/CouponCodeGenerator.ts > coupons.csv +/* + * To run this script: + * export $(grep -v '^#' config.env | xargs) && ts-node ./Scripts/PaymentProvider/CouponCodeGenerator.ts > coupons.csv + */ import { PromiseVoidFunction } from "Common/Types/FunctionTypes"; import Sleep from "Common/Types/Sleep"; import BillingService from "Common/Server/Services/BillingService"; diff --git a/Scripts/TerraformProvider/Core/DataSourceGenerator.ts b/Scripts/TerraformProvider/Core/DataSourceGenerator.ts index f054511de1..85fa8ba6ef 100644 --- a/Scripts/TerraformProvider/Core/DataSourceGenerator.ts +++ b/Scripts/TerraformProvider/Core/DataSourceGenerator.ts @@ -556,8 +556,10 @@ ${this.generateResponseMapping(dataSource, dataSourceVarName + "Response")}`; }) .join("\n"); - // This would update the provider.go file to include the data sources - // For now, we'll create a separate file with the data source list + /* + * This would update the provider.go file to include the data sources + * For now, we'll create a separate file with the data source list + */ const dataSourceListContent: string = `package provider import ( diff --git a/Scripts/TerraformProvider/Core/DocumentationGenerator.ts b/Scripts/TerraformProvider/Core/DocumentationGenerator.ts index 8aece9afc7..464d007495 100644 --- a/Scripts/TerraformProvider/Core/DocumentationGenerator.ts +++ b/Scripts/TerraformProvider/Core/DocumentationGenerator.ts @@ -194,8 +194,10 @@ terraform import ${this.config.providerName}_${resource.name}.example return this.formatOpenAPIExample(attrInfo.example, attrInfo.type); } - // Fallback to the existing hardcoded logic - // Handle specific field types and names + /* + * Fallback to the existing hardcoded logic + * Handle specific field types and names + */ if (fieldName.includes("id") && attrInfo.type === "string") { return '"123e4567-e89b-12d3-a456-426614174000"'; } diff --git a/Scripts/TerraformProvider/Core/OpenAPIParser.ts b/Scripts/TerraformProvider/Core/OpenAPIParser.ts index ec964ce99c..335e937078 100644 --- a/Scripts/TerraformProvider/Core/OpenAPIParser.ts +++ b/Scripts/TerraformProvider/Core/OpenAPIParser.ts @@ -290,8 +290,10 @@ export class OpenAPIParser { computed: true, }; - // First pass: Extract schema from create/update operations (input fields) - // These define the required fields for the resource + /* + * First pass: Extract schema from create/update operations (input fields) + * These define the required fields for the resource + */ if (operations.create) { this.addSchemaFromOperation( schema, @@ -329,19 +331,23 @@ export class OpenAPIParser { ); } - // Third pass: Identify fields that should be both optional and computed - // These are fields that: - // 1. Appear in both create/update AND read operations, but - // 2. Are not required in create/update operations - // This indicates server-managed fields that can be optionally set by users + /* + * Third pass: Identify fields that should be both optional and computed + * These are fields that: + * 1. Appear in both create/update AND read operations, but + * 2. Are not required in create/update operations + * This indicates server-managed fields that can be optionally set by users + */ for (const [fieldName, attr] of Object.entries(schema)) { const isInCreateUpdate: boolean = createUpdateFields.has(fieldName); const isRequired: boolean = requiredFields.has(fieldName); const isComputed: boolean = Boolean(attr.computed); if (isInCreateUpdate && !isRequired && isComputed) { - // Field is optional in create/update but computed in read - // This means it should be both optional and computed + /* + * Field is optional in create/update but computed in read + * This means it should be both optional and computed + */ schema[fieldName] = { ...attr, required: false, @@ -609,8 +615,10 @@ export class OpenAPIParser { existingField.description = description; } - // If the field exists from create/update and now appears in read, - // it should be marked as both optional and computed (server-managed field) + /* + * If the field exists from create/update and now appears in read, + * it should be marked as both optional and computed (server-managed field) + */ if (existingField && !existingField.required) { schema[terraformName] = { ...existingField, @@ -692,8 +700,10 @@ export class OpenAPIParser { case "array": return "list"; case "object": - // For now, treat complex objects as JSON strings to handle nested structures - // This allows users to pass complex nested objects that will be serialized to JSON + /* + * For now, treat complex objects as JSON strings to handle nested structures + * This allows users to pass complex nested objects that will be serialized to JSON + */ return "string"; default: return "string"; diff --git a/Scripts/TerraformProvider/Core/ResourceGenerator.ts b/Scripts/TerraformProvider/Core/ResourceGenerator.ts index e6e5c9483c..8e54062694 100644 --- a/Scripts/TerraformProvider/Core/ResourceGenerator.ts +++ b/Scripts/TerraformProvider/Core/ResourceGenerator.ts @@ -444,8 +444,10 @@ func (r *${resourceTypeName}Resource) parseJSONField(terraformString types.Strin !isInCreateSchema && !isInUpdateSchema ) { - // Fields with defaults that are not in create or update schema should be Computed only - // This prevents drift when the server manages these fields + /* + * Fields with defaults that are not in create or update schema should be Computed only + * This prevents drift when the server manages these fields + */ options.push("Computed: true"); } else { options.push("Optional: true"); @@ -499,8 +501,10 @@ func (r *${resourceTypeName}Resource) parseJSONField(terraformString types.Strin } } - // Add default empty list for all list types to avoid null vs empty list inconsistencies - // Exception: Don't add defaults for computed fields as they should be server-managed + /* + * Add default empty list for all list types to avoid null vs empty list inconsistencies + * Exception: Don't add defaults for computed fields as they should be server-managed + */ if ( attr.type === "list" && !attr.required && @@ -1026,8 +1030,10 @@ func (r *${resourceTypeName}Resource) Delete(ctx context.Context, req resource.D fieldName: string, fieldType: string, ): string { - // For unknown values (computed fields that are "known after apply"), - // we should not include them in update requests + /* + * For unknown values (computed fields that are "known after apply"), + * we should not include them in update requests + */ const baseCondition: string = `!data.${fieldName}.IsUnknown() && !state.${fieldName}.IsUnknown() && !data.${fieldName}.Equal(state.${fieldName})`; switch (fieldType) { @@ -1112,8 +1118,10 @@ func (r *${resourceTypeName}Resource) Delete(ctx context.Context, req resource.D const fieldName: string = StringUtils.toPascalCase(sanitizedName); const apiFieldName: string = attr.apiFieldName || name; // Use original OpenAPI field name - // For update operations, only include the field if it exists in the resource's main schema - // This ensures we only send fields that are defined in the main resource + /* + * For update operations, only include the field if it exists in the resource's main schema + * This ensures we only send fields that are defined in the main resource + */ if (isUpdate && !resource.schema[name]) { continue; } @@ -1257,8 +1265,10 @@ func (r *${resourceTypeName}Resource) Delete(ctx context.Context, req resource.D ${fieldName} = types.StringValue(original${StringUtils.toPascalCase(originalFieldName)}Value) }`; } - // In Read/Update methods, preserve existing value if not present in API response - // This prevents drift detection when API doesn't return binary content + /* + * In Read/Update methods, preserve existing value if not present in API response + * This prevents drift detection when API doesn't return binary content + */ return `if val, ok := ${responseValue}.(string); ok { ${fieldName} = types.StringValue(val) } else { @@ -1411,8 +1421,10 @@ func (r *${resourceTypeName}Resource) Delete(ctx context.Context, req resource.D case "bool": return `${fieldRef}.ValueBool()`; case "map": - // For map types, we need to handle them differently - // For now, we'll skip them in request bodies since they're typically complex objects + /* + * For map types, we need to handle them differently + * For now, we'll skip them in request bodies since they're typically complex objects + */ return `""`; case "list": // For list types, we need to handle them differently @@ -1435,8 +1447,10 @@ func (r *${resourceTypeName}Resource) Delete(ctx context.Context, req resource.D }) .join("\n"); - // This would update the provider.go file to include the resources - // For now, we'll create a separate file with the resource list + /* + * This would update the provider.go file to include the resources + * For now, we'll create a separate file with the resource list + */ const resourceListContent: string = `package provider import ( diff --git a/ServerMonitorIngest/Jobs/ServerMonitorIngest/ProcessServerMonitorIngest.ts b/ServerMonitorIngest/Jobs/ServerMonitorIngest/ProcessServerMonitorIngest.ts index e6f23efdf8..ec9e28b60e 100644 --- a/ServerMonitorIngest/Jobs/ServerMonitorIngest/ProcessServerMonitorIngest.ts +++ b/ServerMonitorIngest/Jobs/ServerMonitorIngest/ProcessServerMonitorIngest.ts @@ -32,9 +32,11 @@ QueueWorker.getWorker( `Successfully processed server monitor ingestion job: ${job.name}`, ); } catch (error) { - // Certain BadDataException cases are expected / non-actionable and should not fail the job. - // These include disabled monitors (manual, maintenance, explicitly disabled) and missing monitors - // (e.g. secret key referencing a deleted monitor). Retrying provides no value and only creates noise. + /* + * Certain BadDataException cases are expected / non-actionable and should not fail the job. + * These include disabled monitors (manual, maintenance, explicitly disabled) and missing monitors + * (e.g. secret key referencing a deleted monitor). Retrying provides no value and only creates noise. + */ if ( error instanceof BadDataException && (error.message === ExceptionMessages.MonitorNotFound || diff --git a/TestServer/API/Main.ts b/TestServer/API/Main.ts index f499d8adee..f642293023 100644 --- a/TestServer/API/Main.ts +++ b/TestServer/API/Main.ts @@ -71,8 +71,10 @@ const returnResponse: RequestHandler = async ( await Sleep.sleep(responseTime); } - // middleware marks the probe as alive. - // so we don't need to do anything here. + /* + * middleware marks the probe as alive. + * so we don't need to do anything here. + */ return Response.sendCustomResponse( req, res, diff --git a/TestServer/API/Settings.ts b/TestServer/API/Settings.ts index cd3c4b7b9b..823fdc20e1 100644 --- a/TestServer/API/Settings.ts +++ b/TestServer/API/Settings.ts @@ -51,8 +51,10 @@ router.post( LocalCache.setNumber("TestServer", "responseTime", responseTime || 0); LocalCache.setString("TestServer", "responseBody", responseBody || ""); - // middleware marks the probe as alive. - // so we don't need to do anything here. + /* + * middleware marks the probe as alive. + * so we don't need to do anything here. + */ return Response.sendEmptySuccessResponse(req, res); } catch (err) { return next(err); diff --git a/Worker/DataMigrations/AddAlertNumber.ts b/Worker/DataMigrations/AddAlertNumber.ts index b6534a8654..0a5dde286f 100644 --- a/Worker/DataMigrations/AddAlertNumber.ts +++ b/Worker/DataMigrations/AddAlertNumber.ts @@ -27,8 +27,10 @@ export default class AddAlertNumber extends DataMigrationBase { }); for (const project of projects) { - // add ended scheduled maintenance state for each of these projects. - // first fetch resolved state. Ended state order is -1 of resolved state. + /* + * add ended scheduled maintenance state for each of these projects. + * first fetch resolved state. Ended state order is -1 of resolved state. + */ // get all incicents for this project const alerts: Array = await AlertService.findBy({ diff --git a/Worker/DataMigrations/AddDowntimeMonitorStatusToStatusPage.ts b/Worker/DataMigrations/AddDowntimeMonitorStatusToStatusPage.ts index 6ba0a19e37..e952d29ddf 100644 --- a/Worker/DataMigrations/AddDowntimeMonitorStatusToStatusPage.ts +++ b/Worker/DataMigrations/AddDowntimeMonitorStatusToStatusPage.ts @@ -29,8 +29,10 @@ export default class AddDowntimeMonitorStatusToStatusPage extends DataMigrationB }); for (const statusPage of statusPages) { - // add ended scheduled maintenance state for each of these projects. - // first fetch resolved state. Ended state order is -1 of resolved state. + /* + * add ended scheduled maintenance state for each of these projects. + * first fetch resolved state. Ended state order is -1 of resolved state. + */ if (!statusPage.projectId) { continue; diff --git a/Worker/DataMigrations/AddEndDateToIncidentStateTimeline.ts b/Worker/DataMigrations/AddEndDateToIncidentStateTimeline.ts index 3dbb719ce2..494b90ea58 100644 --- a/Worker/DataMigrations/AddEndDateToIncidentStateTimeline.ts +++ b/Worker/DataMigrations/AddEndDateToIncidentStateTimeline.ts @@ -30,8 +30,10 @@ export default class AddEndDateToIncidentStateTimeline extends DataMigrationBase }); for (const project of projects) { - // add ended scheduled maintenance state for each of these projects. - // first fetch resolved state. Ended state order is -1 of resolved state. + /* + * add ended scheduled maintenance state for each of these projects. + * first fetch resolved state. Ended state order is -1 of resolved state. + */ const incidents: Array = await IncidentService.findBy({ query: { diff --git a/Worker/DataMigrations/AddEndDateToMonitorStatusTimeline.ts b/Worker/DataMigrations/AddEndDateToMonitorStatusTimeline.ts index e1a56c977d..1f2e71a1f9 100644 --- a/Worker/DataMigrations/AddEndDateToMonitorStatusTimeline.ts +++ b/Worker/DataMigrations/AddEndDateToMonitorStatusTimeline.ts @@ -30,8 +30,10 @@ export default class AddEndDateToMonitorStatusTimeline extends DataMigrationBase }); for (const project of projects) { - // add ended scheduled maintenance state for each of these projects. - // first fetch resolved state. Ended state order is -1 of resolved state. + /* + * add ended scheduled maintenance state for each of these projects. + * first fetch resolved state. Ended state order is -1 of resolved state. + */ const monitors: Array = await MonitorService.findBy({ query: { diff --git a/Worker/DataMigrations/AddEndDateToMonitorStatusTimelineWhereEndDateIsMissing.ts b/Worker/DataMigrations/AddEndDateToMonitorStatusTimelineWhereEndDateIsMissing.ts index 412bd2dafb..a0bb439aa1 100644 --- a/Worker/DataMigrations/AddEndDateToMonitorStatusTimelineWhereEndDateIsMissing.ts +++ b/Worker/DataMigrations/AddEndDateToMonitorStatusTimelineWhereEndDateIsMissing.ts @@ -29,8 +29,10 @@ export default class AddEndDateToMonitorStatusTimelineWhereEndDateIsMissing exte }); for (const project of projects) { - // add ended scheduled maintenance state for each of these projects. - // first fetch resolved state. Ended state order is -1 of resolved state. + /* + * add ended scheduled maintenance state for each of these projects. + * first fetch resolved state. Ended state order is -1 of resolved state. + */ const monitors: Array = await MonitorService.findBy({ query: { diff --git a/Worker/DataMigrations/AddEndDateToScheduledEventsStateTimeline.ts b/Worker/DataMigrations/AddEndDateToScheduledEventsStateTimeline.ts index 4479c7b111..1a6a52ebbd 100644 --- a/Worker/DataMigrations/AddEndDateToScheduledEventsStateTimeline.ts +++ b/Worker/DataMigrations/AddEndDateToScheduledEventsStateTimeline.ts @@ -30,8 +30,10 @@ export default class AddEndDateToScheduledEventsStateTimeline extends DataMigrat }); for (const project of projects) { - // add ended scheduled maintenance state for each of these projects. - // first fetch resolved state. Ended state order is -1 of resolved state. + /* + * add ended scheduled maintenance state for each of these projects. + * first fetch resolved state. Ended state order is -1 of resolved state. + */ const scheduledEvents: Array = await ScheduledMaintenanceService.findBy({ diff --git a/Worker/DataMigrations/AddEndedState.ts b/Worker/DataMigrations/AddEndedState.ts index c67f8754b6..35a6419626 100644 --- a/Worker/DataMigrations/AddEndedState.ts +++ b/Worker/DataMigrations/AddEndedState.ts @@ -27,8 +27,10 @@ export default class AddEndedState extends DataMigrationBase { }); for (const project of projects) { - // add ended scheduled maintenance state for each of these projects. - // first fetch resolved state. Ended state order is -1 of resolved state. + /* + * add ended scheduled maintenance state for each of these projects. + * first fetch resolved state. Ended state order is -1 of resolved state. + */ const resolvedState: ScheduledMaintenanceState | null = await ScheduledMaintenanceStateService.findOneBy({ diff --git a/Worker/DataMigrations/AddIncidentNumber.ts b/Worker/DataMigrations/AddIncidentNumber.ts index 8a95c40920..67d5e8848f 100644 --- a/Worker/DataMigrations/AddIncidentNumber.ts +++ b/Worker/DataMigrations/AddIncidentNumber.ts @@ -27,8 +27,10 @@ export default class AddIncidentNumber extends DataMigrationBase { }); for (const project of projects) { - // add ended scheduled maintenance state for each of these projects. - // first fetch resolved state. Ended state order is -1 of resolved state. + /* + * add ended scheduled maintenance state for each of these projects. + * first fetch resolved state. Ended state order is -1 of resolved state. + */ // get all incicents for this project const incidents: Array = await IncidentService.findBy({ diff --git a/Worker/DataMigrations/AddScheduledMaintenanceNumber.ts b/Worker/DataMigrations/AddScheduledMaintenanceNumber.ts index f7049c014f..9484fd3462 100644 --- a/Worker/DataMigrations/AddScheduledMaintenanceNumber.ts +++ b/Worker/DataMigrations/AddScheduledMaintenanceNumber.ts @@ -27,8 +27,10 @@ export default class AddScheduledMaintenanceNumber extends DataMigrationBase { }); for (const project of projects) { - // add ended scheduled maintenance state for each of these projects. - // first fetch resolved state. Ended state order is -1 of resolved state. + /* + * add ended scheduled maintenance state for each of these projects. + * first fetch resolved state. Ended state order is -1 of resolved state. + */ // get all incicents for this project const scheduledMaintenances: Array = diff --git a/Worker/DataMigrations/AddStartDateToIncidentStateTimeline.ts b/Worker/DataMigrations/AddStartDateToIncidentStateTimeline.ts index 1d62adfb7f..f2debff164 100644 --- a/Worker/DataMigrations/AddStartDateToIncidentStateTimeline.ts +++ b/Worker/DataMigrations/AddStartDateToIncidentStateTimeline.ts @@ -30,8 +30,10 @@ export default class AddStartDateToIncidentStateTimeline extends DataMigrationBa }); for (const project of projects) { - // add ended scheduled maintenance state for each of these projects. - // first fetch resolved state. Ended state order is -1 of resolved state. + /* + * add ended scheduled maintenance state for each of these projects. + * first fetch resolved state. Ended state order is -1 of resolved state. + */ const incidents: Array = await IncidentService.findBy({ query: { diff --git a/Worker/DataMigrations/AddStartDateToMonitorStatusTimeline.ts b/Worker/DataMigrations/AddStartDateToMonitorStatusTimeline.ts index a0f5470e86..fc855809b0 100644 --- a/Worker/DataMigrations/AddStartDateToMonitorStatusTimeline.ts +++ b/Worker/DataMigrations/AddStartDateToMonitorStatusTimeline.ts @@ -30,8 +30,10 @@ export default class AddStartDateToMonitorStatusTimeline extends DataMigrationBa }); for (const project of projects) { - // add ended scheduled maintenance state for each of these projects. - // first fetch resolved state. Ended state order is -1 of resolved state. + /* + * add ended scheduled maintenance state for each of these projects. + * first fetch resolved state. Ended state order is -1 of resolved state. + */ const monitors: Array = await MonitorService.findBy({ query: { diff --git a/Worker/DataMigrations/AddStartDateToScheduledEventsStateTimeline.ts b/Worker/DataMigrations/AddStartDateToScheduledEventsStateTimeline.ts index bbc6f158e1..bb3e07a61c 100644 --- a/Worker/DataMigrations/AddStartDateToScheduledEventsStateTimeline.ts +++ b/Worker/DataMigrations/AddStartDateToScheduledEventsStateTimeline.ts @@ -30,8 +30,10 @@ export default class AddStartDateToScheduledEventsStateTimeline extends DataMigr }); for (const project of projects) { - // add ended scheduled maintenance state for each of these projects. - // first fetch resolved state. Ended state order is -1 of resolved state. + /* + * add ended scheduled maintenance state for each of these projects. + * first fetch resolved state. Ended state order is -1 of resolved state. + */ const scheduledEvents: Array = await ScheduledMaintenanceService.findBy({ diff --git a/Worker/DataMigrations/DeleteOldTelelmetryTable.ts b/Worker/DataMigrations/DeleteOldTelelmetryTable.ts index 36794054ab..4c9355fe96 100644 --- a/Worker/DataMigrations/DeleteOldTelelmetryTable.ts +++ b/Worker/DataMigrations/DeleteOldTelelmetryTable.ts @@ -11,8 +11,10 @@ export default class DeleteOldTelemetryTable extends DataMigrationBase { public override async migrate(): Promise { try { - // delete old telemetry tables that are no longer needed - // we have renamed these tables to new names + /* + * delete old telemetry tables that are no longer needed + * we have renamed these tables to new names + */ await MetricService.executeQuery("DROP TABLE IF EXISTS Metric"); await SpanService.executeQuery("DROP TABLE IF EXISTS Span"); await LogService.executeQuery("DROP TABLE IF EXISTS Log"); diff --git a/Worker/DataMigrations/RenameRuleTypeInUserNotificationRule.ts b/Worker/DataMigrations/RenameRuleTypeInUserNotificationRule.ts index cf45176ad2..14dbed09b3 100644 --- a/Worker/DataMigrations/RenameRuleTypeInUserNotificationRule.ts +++ b/Worker/DataMigrations/RenameRuleTypeInUserNotificationRule.ts @@ -11,10 +11,12 @@ export default class RenameRuleTypeInUserNotificationRule extends DataMigrationB } public override async migrate(): Promise { - // get all projects. - // for each project get all UserNotifiacationRules with ruleType ""When incident is created during on call" - // update ruleType to "When on-call policy is executed" - // update UserNotificationRule + /* + * get all projects. + * for each project get all UserNotifiacationRules with ruleType ""When incident is created during on call" + * update ruleType to "When on-call policy is executed" + * update UserNotificationRule + */ const projects: Array = await ProjectService.findBy({ query: {}, diff --git a/Worker/DataMigrations/StartOnCallUserTimeLog.ts b/Worker/DataMigrations/StartOnCallUserTimeLog.ts index 31dac44237..0415d18262 100644 --- a/Worker/DataMigrations/StartOnCallUserTimeLog.ts +++ b/Worker/DataMigrations/StartOnCallUserTimeLog.ts @@ -18,12 +18,14 @@ export default class StartOnCallUserTimeLog extends DataMigrationBase { } public override async migrate(): Promise { - // get on call escalaton rules. - // first for users - // then for teams. - // for teams, get the team members and create time logs for them. - // then for schedules. - // create logs for the current user. + /* + * get on call escalaton rules. + * first for users + * then for teams. + * for teams, get the team members and create time logs for them. + * then for schedules. + * create logs for the current user. + */ try { const escalationRulesForUsers: Array = diff --git a/Worker/Jobs/IncomingRequestMonitor/CheckHeartbeat.ts b/Worker/Jobs/IncomingRequestMonitor/CheckHeartbeat.ts index 6ef3df6e58..d9bd358f7e 100644 --- a/Worker/Jobs/IncomingRequestMonitor/CheckHeartbeat.ts +++ b/Worker/Jobs/IncomingRequestMonitor/CheckHeartbeat.ts @@ -178,9 +178,11 @@ type ShouldProcessRequestFunction = (monitor: Monitor) => boolean; const shouldProcessRequest: ShouldProcessRequestFunction = ( monitor: Monitor, ): boolean => { - // check if any criteria has request time step. If yes, then process the request. If no then skip the request. - // We dont want Incoming Request Monitor to process the request if there is no criteria that checks for incoming request. - // Those monitors criteria should be checked if the request is receievd from the API and not through the worker. + /* + * check if any criteria has request time step. If yes, then process the request. If no then skip the request. + * We dont want Incoming Request Monitor to process the request if there is no criteria that checks for incoming request. + * Those monitors criteria should be checked if the request is receievd from the API and not through the worker. + */ let shouldWeProcessRequest: boolean = false; diff --git a/Worker/Jobs/Monitor/KeepCurrentStateConsistent.ts b/Worker/Jobs/Monitor/KeepCurrentStateConsistent.ts index 287157c325..0db42f97c3 100644 --- a/Worker/Jobs/Monitor/KeepCurrentStateConsistent.ts +++ b/Worker/Jobs/Monitor/KeepCurrentStateConsistent.ts @@ -12,8 +12,10 @@ RunCron( { schedule: EVERY_DAY, runOnStartup: true }, async () => { try { - // get all projects, then get all monitors for each project, then get the last status of each monitor and check with the current status of each monitor. - // if they are different, then update the current status of the monitor. + /* + * get all projects, then get all monitors for each project, then get the last status of each monitor and check with the current status of each monitor. + * if they are different, then update the current status of the monitor. + */ const projects: Array = await ProjectService.findBy({ query: { diff --git a/Worker/Jobs/ScheduledMaintenance/KeepCurrentStateConsistent.ts b/Worker/Jobs/ScheduledMaintenance/KeepCurrentStateConsistent.ts index 0397998fc3..178d2131d7 100644 --- a/Worker/Jobs/ScheduledMaintenance/KeepCurrentStateConsistent.ts +++ b/Worker/Jobs/ScheduledMaintenance/KeepCurrentStateConsistent.ts @@ -12,8 +12,10 @@ RunCron( { schedule: EVERY_DAY, runOnStartup: true }, async () => { try { - // get all projects, then get all scheduled maintenances for each project, then get the last state of each scheduled maintenance and check with the current state of each scheduled maintenance. - // if they are different, then update the current state of the scheduled maintenance. + /* + * get all projects, then get all scheduled maintenances for each project, then get the last state of each scheduled maintenance and check with the current state of each scheduled maintenance. + * if they are different, then update the current state of the scheduled maintenance. + */ const projects: Array = await ProjectService.findBy({ query: { diff --git a/Worker/Jobs/TelemetryService/DeleteOldData.ts b/Worker/Jobs/TelemetryService/DeleteOldData.ts index 434f8d34a1..523ea3952d 100644 --- a/Worker/Jobs/TelemetryService/DeleteOldData.ts +++ b/Worker/Jobs/TelemetryService/DeleteOldData.ts @@ -14,9 +14,11 @@ RunCron( { schedule: IsDevelopment ? EVERY_MINUTE : EVERY_HOUR, runOnStartup: false, - // This job iterates over all telemetry services and issues ClickHouse DELETE mutations - // which can take longer than the default 5 minute job timeout when there is a lot of data. - // Increase timeout to 25 minutes (just under the hourly schedule) to prevent premature timeouts. + /* + * This job iterates over all telemetry services and issues ClickHouse DELETE mutations + * which can take longer than the default 5 minute job timeout when there is a lot of data. + * Increase timeout to 25 minutes (just under the hourly schedule) to prevent premature timeouts. + */ timeoutInMS: OneUptimeDate.convertMinutesToMilliseconds(30), }, async () => { diff --git a/Workflow/Services/RunWorkflow.ts b/Workflow/Services/RunWorkflow.ts index 14b6f87295..51d595d7ab 100644 --- a/Workflow/Services/RunWorkflow.ts +++ b/Workflow/Services/RunWorkflow.ts @@ -100,8 +100,10 @@ export default class RunWorkflow { this.projectId = workflow.projectId || null; if (!runProps.workflowLogId) { - // create a new workflow log here. - // if the workflow is to be run immediately. + /* + * create a new workflow log here. + * if the workflow is to be run immediately. + */ const runLog: WorkflowLog = new WorkflowLog(); runLog.workflowId = runProps.workflowId; runLog.projectId = workflow.projectId!; @@ -168,8 +170,10 @@ export default class RunWorkflow { ); } - // get component. - // and remove that component from the stack. + /* + * get component. + * and remove that component from the stack. + */ executeComponentId = fifoStackOfComponentsPendingExecution.shift()!; if (componentsExecuted.includes(executeComponentId)) { diff --git a/eslint.config.js b/eslint.config.js index 5639ef2918..0ee6c601e6 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -60,7 +60,7 @@ export default tseslint.config( "@typescript-eslint/no-duplicate-enum-values": "off", // TODO: Remove this rule "no-constant-binary-expression": "off", // TODO: Remove this rule "@typescript-eslint/ban-ts-comment": "off", // TODO: Remove this rule - "multiline-comment-style": "off", // TODO: Remove this rule + "multiline-comment-style": "error", // TODO: Remove this rule "@typescript-eslint/no-floating-promises": "off", // TODO: Remove this rule "no-fallthrough": "error", "no-unreachable": "error",