Skip to content

Commit

Permalink
format and stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
naueramant committed Jan 28, 2024
1 parent 05fc4ee commit 2b546ca
Show file tree
Hide file tree
Showing 52 changed files with 402 additions and 394 deletions.
6 changes: 6 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
node_modules
dist
.turbo
*.json
*.lock
*.yaml
4 changes: 2 additions & 2 deletions apps/dashboard/src/api/endpoints/authentication.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export interface ILoginResponse {

export async function login(
email: string,
password: string
password: string,
): Promise<ILoginResponse> {
const data: ILoginRequest = {
email: email,
Expand Down Expand Up @@ -51,7 +51,7 @@ export async function refresh(refreshToken: string): Promise<IRefreshResponse> {
headers: {
Authorization: "", // Skip auth interceptor
},
}
},
);

return response.data;
Expand Down
12 changes: 6 additions & 6 deletions apps/dashboard/src/api/endpoints/changelogs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export async function getChangelogs(
teamId: number,
offset?: number,
limit?: number,
query?: string
query?: string,
): Promise<IChangelogsResponse> {
const response = await client.get(`/v1/teams/${teamId}/changelogs`, {
params: {
Expand All @@ -33,18 +33,18 @@ export interface IChangelogResponse extends IChangelog {}

export async function getChangelog(
teamId: number,
changelogId: number
changelogId: number,
): Promise<IChangelogResponse> {
const response = await client.get(
`/v1/teams/${teamId}/changelogs/${changelogId}`
`/v1/teams/${teamId}/changelogs/${changelogId}`,
);

return response?.data;
}

export async function postChangelog(
teamId: number,
name: string
name: string,
): Promise<IChangelogResponse> {
const response = await client.post(`/v1/teams/${teamId}/changelogs`, {
name,
Expand All @@ -55,10 +55,10 @@ export async function postChangelog(

export async function deleteChangelog(
teamId: number,
changelogId: number
changelogId: number,
): Promise<void> {
const response = await client.delete(
`/v1/teams/${teamId}/changelogs/${changelogId}`
`/v1/teams/${teamId}/changelogs/${changelogId}`,
);

return response?.data;
Expand Down
24 changes: 12 additions & 12 deletions apps/dashboard/src/api/endpoints/monitors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export async function getMonitors(
teamId: number,
offset?: number,
limit?: number,
query?: string
query?: string,
): Promise<GetMonitorsResponse> {
const response = await client.get(`/v1/teams/${teamId}/monitors`, {
params: {
Expand All @@ -58,10 +58,10 @@ export async function getMonitors(

export async function getMonitor(
teamId: number,
monitorId: number
monitorId: number,
): Promise<IMonitorResponse> {
const response = await client.get(
`/v1/teams/${teamId}/monitors/${monitorId}`
`/v1/teams/${teamId}/monitors/${monitorId}`,
);
return response?.data;
}
Expand All @@ -84,7 +84,7 @@ export interface IPostMonitorRequest {

export async function postMonitor(
teamId: number,
data: IPostMonitorRequest
data: IPostMonitorRequest,
): Promise<void> {
const response = await client.post(`/v1/teams/${teamId}/monitors`, data);
return response?.data;
Expand All @@ -98,7 +98,7 @@ export async function getMonitorChecks(
teamId: number,
monitorId: number,
offset?: number,
limit?: number
limit?: number,
): Promise<IMonitorChecksResponse> {
const response = await client.get(
`/v1/teams/${teamId}/monitors/${monitorId}/checks`,
Expand All @@ -107,7 +107,7 @@ export async function getMonitorChecks(
offset,
limit,
},
}
},
);

return response?.data;
Expand All @@ -116,10 +116,10 @@ export async function getMonitorChecks(
export async function getMonitorCheck(
teamId: number,
monitorId: number,
checkId: number
checkId: number,
): Promise<Check> {
const response = await client.get(
`/v1/teams/${teamId}/monitors/${monitorId}/checks/${checkId}`
`/v1/teams/${teamId}/monitors/${monitorId}/checks/${checkId}`,
);

return response?.data;
Expand All @@ -130,17 +130,17 @@ export interface IMonitorMetricsResponse {

export async function getMonitorMetrics(
teamId: number,
monitorId: number
monitorId: number,
): Promise<IMonitorMetricsResponse> {
const response = await client.get(
`/v1/teams/${teamId}/monitors/${monitorId}/metrics`
`/v1/teams/${teamId}/monitors/${monitorId}/metrics`,
);
return response?.data;
}

export async function deleteMonitor(
teamId: number,
monitorId: number
monitorId: number,
): Promise<void> {
await client.delete(`/v1/teams/${teamId}/monitors/${monitorId}`);
}
Expand All @@ -154,7 +154,7 @@ export interface IPutMonitorRequest {
export async function putMonitor(
teamId: number,
monitorId: number,
data: IPutMonitorRequest
data: IPutMonitorRequest,
): Promise<void> {
await client.put(`/v1/teams/${teamId}/monitors/${monitorId}`, data);
}
22 changes: 11 additions & 11 deletions apps/dashboard/src/api/endpoints/teams.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export interface IGetTeamResponse {
}

export async function getTeam(
teamId: string | number
teamId: string | number,
): Promise<IGetTeamResponse> {
const response = await client.get<IGetTeamResponse>(`/v1/teams/${teamId}`);
return response.data;
Expand All @@ -23,7 +23,7 @@ export interface IPutTeamRequest {

export async function putTeam(
teamId: string | number,
data: IPutTeamRequest
data: IPutTeamRequest,
): Promise<void> {
await client.put(`/v1/teams/${teamId}`, data);
}
Expand All @@ -46,7 +46,7 @@ export async function getUsers(
teamId: string | number,
offset?: number,
limit?: number,
query?: string
query?: string,
): Promise<IGetTeamUsersResponse> {
const response = await client.get(`/v1/teams/${teamId}/users`, {
params: {
Expand All @@ -61,7 +61,7 @@ export async function getUsers(

export async function removeUser(
teamId: string | number,
userId: string | number
userId: string | number,
): Promise<void> {
return await client.delete(`/v1/teams/${teamId}/users/${userId}`);
}
Expand All @@ -75,13 +75,13 @@ export interface IPostTeamNameAvailableResponse {
}

export async function postNameAvailable(
name: string
name: string,
): Promise<IPostTeamNameAvailableResponse> {
const response = await client.post<IPostTeamNameAvailableResponse>(
`/v1/teams/available`,
{
name,
}
},
);
return response.data;
}
Expand All @@ -101,7 +101,7 @@ export interface IPostTeamResponse {

export async function postTeam(
name: string,
displayName: string
displayName: string,
): Promise<IPostTeamResponse> {
const response = await client.post<IPostTeamResponse>(`/v1/teams`, {
name,
Expand All @@ -122,7 +122,7 @@ export interface IPutTeamUserRequest {
export async function putTeamUser(
teamId: string | number,
userId: string | number,
data: IPutTeamUserRequest
data: IPutTeamUserRequest,
): Promise<void> {
await client.put(`/v1/teams/${teamId}/users/${userId}`, data);
}
Expand All @@ -134,14 +134,14 @@ export interface IPostTeamUserInviteRequest {

export async function postTeamUserInvite(
teamId: string | number,
data: IPostTeamUserInviteRequest
data: IPostTeamUserInviteRequest,
): Promise<void> {
await client.post(`/v1/teams/${teamId}/users/invites`, data);
}

export async function updateAvatar(
teamId: number | string,
data: string | Blob
data: string | Blob,
): Promise<void> {
const form = new FormData();
form.append("file", data);
Expand All @@ -155,7 +155,7 @@ export async function acceptInvite(token: string): Promise<void> {

export async function postCreateCheckoutSession(
teamId: string | number,
priceLookupKey: string
priceLookupKey: string,
): Promise<void> {
console.log(teamId, priceLookupKey);
await client.post(`/v1/teams/${teamId}/create-checkout-session`, {
Expand Down
8 changes: 4 additions & 4 deletions apps/dashboard/src/api/endpoints/users.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export interface IGetUserTeamResponse {
}

export async function getUser(
userId: number | string
userId: number | string,
): Promise<IGetUserResponse> {
const response = await client.get(`/v1/users/${userId}`);
return response?.data;
Expand All @@ -37,7 +37,7 @@ export interface IPutUserRequest {

export async function updateUser(
userId: number | string,
data: IPutUserRequest
data: IPutUserRequest,
): Promise<void> {
const response = await client.put(`/v1/users/${userId}`, data);
return response?.data;
Expand All @@ -46,7 +46,7 @@ export async function updateUser(
export async function updatePassword(
userId: number | string,
oldPassword: string,
newPassword: string
newPassword: string,
): Promise<void> {
await client.put(`/v1/users/${userId}/password`, {
oldPassword,
Expand All @@ -56,7 +56,7 @@ export async function updatePassword(

export async function updateAvatar(
userId: number | string,
data: string | Blob
data: string | Blob,
): Promise<void> {
const form = new FormData();
form.append("file", data);
Expand Down
4 changes: 2 additions & 2 deletions apps/dashboard/src/api/interceptors/logout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export function LogOutInterceptor(inst: AxiosInstance) {
},
async (error) => {
return Promise.reject(error);
}
},
);

inst.interceptors.response.use(
Expand All @@ -35,6 +35,6 @@ export function LogOutInterceptor(inst: AxiosInstance) {
}

return Promise.reject(error);
}
},
);
}
6 changes: 3 additions & 3 deletions apps/dashboard/src/api/interceptors/token.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export function TokenInterceptor(inst: AxiosInstance) {
},
(error) => {
Promise.reject(error);
}
},
);
}

Expand All @@ -53,12 +53,12 @@ let refreshSubscribers: ((failure?: boolean) => void)[] = [];

async function refreshTokens(
axiosInst: AxiosInstance,
authStore: AuthenticationState
authStore: AuthenticationState,
): Promise<void> {
if (isRefreshing) {
return new Promise((resolve, reject) => {
subscribeTokenRefresh((failure?: boolean) =>
failure ? reject() : resolve()
failure ? reject() : resolve(),
);
});
}
Expand Down
2 changes: 1 addition & 1 deletion apps/dashboard/src/components/DataGrid/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ interface CustomNoRowsOverlayProps {
}

const CustomNoRowsOverlay: FunctionComponent<CustomNoRowsOverlayProps> = (
props
props,
) => {
return (
<Box
Expand Down
2 changes: 1 addition & 1 deletion apps/dashboard/src/components/DelayedVisibility/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ interface DelayedVisibilityProps {
}

const DelayedVisibility: FunctionComponent<DelayedVisibilityProps> = (
props
props,
) => {
const [visible, setVisible] = useState(false);

Expand Down
2 changes: 1 addition & 1 deletion apps/dashboard/src/components/EditableInput/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ interface EditableInputIndicatorProps {
}

const EditableInputIndicator: FunctionComponent<EditableInputIndicatorProps> = (
props
props,
) => {
const theme = useTheme();

Expand Down
6 changes: 3 additions & 3 deletions apps/dashboard/src/components/RequestTimeline/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,13 @@ const RequestTimeline: FunctionComponent<RequestTimelineProps> = (props) => {
const preTransferWidth = getRowWidth(phases.tlsHandshake, total);
const preTransferOffset = getRowWidth(
phases.dnsLookup + phases.tcpConnection,
total
total,
);

const startTransferWidth = getRowWidth(phases.serverProcessing, total);
const startTransferOffset = getRowWidth(
phases.dnsLookup + phases.tcpConnection + phases.tlsHandshake,
total
total,
);

const contentTransferWidth = getRowWidth(phases.contentTransfer, total);
Expand All @@ -55,7 +55,7 @@ const RequestTimeline: FunctionComponent<RequestTimelineProps> = (props) => {
phases.tcpConnection +
phases.tlsHandshake +
phases.serverProcessing,
total
total,
);

return (
Expand Down
2 changes: 1 addition & 1 deletion apps/dashboard/src/components/ResultThumbGraph/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const Line = styled("div")(
height: `${value}%`,
width: 8,
backgroundColor: theme?.palette.success.main,
})
}),
);

interface ResultThumbGraphProps {
Expand Down
Loading

0 comments on commit 2b546ca

Please sign in to comment.