Skip to content

Commit

Permalink
chore: exported interfaces
Browse files Browse the repository at this point in the history
  • Loading branch information
web-mi committed Feb 2, 2024
1 parent eddcc66 commit ad8fcc8
Show file tree
Hide file tree
Showing 96 changed files with 201 additions and 166 deletions.
2 changes: 1 addition & 1 deletion cypress/e2e/videoconference.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
mockWebSocket,
startWebSocketServer
} from '../support/websocket';
import { AppointmentsDataInterface } from '../../src/globalState/interfaces/AppointmentsDataInterface';
import { AppointmentsDataInterface } from '../../src/globalState/interfaces';

class FakeJitsiMeetExternalAPI {
private _handler: {
Expand Down
2 changes: 1 addition & 1 deletion cypress/support/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import './commands/mockApi';
import './commands/socket';

import { LoginArgs } from './commands/login';
import { AppointmentsDataInterface } from '../../src/globalState/interfaces/AppointmentsDataInterface';
import { AppointmentsDataInterface } from '../../src/globalState/interfaces';

declare global {
namespace Cypress {
Expand Down
4 changes: 2 additions & 2 deletions cypress/support/commands/appointments.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { v4 as uuid } from 'uuid';
import { deepMerge } from '../helpers';
import { AppointmentsDataInterface } from '../../../src/globalState/interfaces/AppointmentsDataInterface';
import { AppointmentsDataInterface } from '../../../src/globalState/interfaces';

export let appointments: AppointmentsDataInterface[] = [];

Expand Down Expand Up @@ -31,7 +31,7 @@ export const updateAppointment = (
Cypress.Commands.add(
'appointments',
(props?: { [key: string]: any }, index?: number) =>
new Promise((resolve) => {
new Cypress.Promise((resolve) => {
let appointment = undefined;
if (!props) {
setAppointments([]);
Expand Down
2 changes: 1 addition & 1 deletion cypress/support/commands/askerSessions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export const updateAskerSession = (
Cypress.Commands.add(
'askerSession',
(props: { [key: string]: any } = {}, index?: number) =>
new Promise((resolve) => {
new Cypress.Promise((resolve) => {
updateAskerSession(props, index);
resolve(undefined);
})
Expand Down
2 changes: 1 addition & 1 deletion cypress/support/commands/consultantSessions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export const updateConsultantSession = (
Cypress.Commands.add(
'consultantSession',
(props: { [key: string]: any } = {}, index?: number) =>
new Promise((resolve) => {
new Cypress.Promise((resolve) => {
updateConsultantSession(props, index);
resolve(undefined);
})
Expand Down
2 changes: 1 addition & 1 deletion cypress/support/commands/login.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { UserDataInterface } from '../../../src/globalState';
import { UserDataInterface } from '../../../src/globalState/interfaces';
import { CyHttpMessages, RouteHandler } from 'cypress/types/net-stubbing';

export const USER_ASKER = 'asker';
Expand Down
2 changes: 1 addition & 1 deletion cypress/support/commands/messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export const addMessage = (
Cypress.Commands.add(
'addMessage',
(props: { [key: string]: any } = {}, index?: number) =>
new Promise((resolve) => {
new Cypress.Promise((resolve) => {
addMessage(props, index);
resolve(undefined);
})
Expand Down
45 changes: 45 additions & 0 deletions cypress/support/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/// <reference types="cypress" />

import { LoginArgs } from './commands/login';
import { AppointmentsDataInterface } from '../../src/globalState/interfaces';
import * as Bluebird from 'cypress/types/bluebird';

declare global {
namespace Cypress {
interface Chainable {
login(args?: LoginArgs): Chainable<Element>;

fastLogin(args?: LoginArgs): Chainable<Element>;

appointments(
args?: Partial<AppointmentsDataInterface>,
index?: number
): Bluebird<unknown>;

askerSession(
args?: { [key: string]: any },
index?: number
): Bluebird<unknown>;

consultantSession(
args?: { [key: string]: any },
index?: number
): Bluebird<unknown>;

addMessage(
props?: { [key: string]: any },
index?: number
): Bluebird<unknown>;

mockApi(): Chainable<Element>;

willReturn(name: string, data: any): Chainable<Element>;

emitDirectMessage(index?: number): Chainable<Element>;

emitVideoCallRequest(): Chainable<Element>;

waitForSubscriptions(events: string[]): Chainable<Element>;
}
}
}
2 changes: 1 addition & 1 deletion cypress/support/sessions.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { v4 as uuid } from 'uuid';
import { SESSION_LIST_TYPES } from '../../src/components/session/sessionHelpers';
import { SessionUserDataInterface } from '../../src/globalState';
import { SessionUserDataInterface } from '../../src/globalState/interfaces';

export const generateConsultantSession = ({
type,
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,8 @@
"dev": "node scripts/start.js",
"dev:server": "nodemon",
"build": "node scripts/build.js",
"test": "cross-env BROWSER=none REACT_APP_API_URL=http://127.0.0.1:9001 HTTPS=0 PORT=9001 WDS_SOCKET_PORT=9001 concurrently --kill-others --success first \"npm run dev\" \"wait-on http://127.0.0.1:9001 && cypress run\"",
"test:build": "cross-env BROWSER=none PORT=9001 CYPRESS_WS_URL=http://127.0.0.1:9002 REACT_APP_API_URL=http://127.0.0.1:9001 concurrently --kill-others --success first \"npm run start\" \"wait-on http://127.0.0.1:9001 && cypress run\"",
"test": "cross-env FAST_REFRESH=false BROWSER=none REACT_APP_API_URL=http://127.0.0.1:9001 HTTPS=0 PORT=9001 WDS_SOCKET_PORT=9001 concurrently --kill-others --success first \"npm run dev\" \"wait-on http://127.0.0.1:9001 && cypress run\"",
"test:build": "cross-env FAST_REFRESH=false BROWSER=none PORT=9001 CYPRESS_WS_URL=http://127.0.0.1:9002 REACT_APP_API_URL=http://127.0.0.1:9001 concurrently --kill-others --success first \"npm run start\" \"wait-on http://127.0.0.1:9001 && cypress run\"",
"release": "standard-version",
"lint": "npm run lint:scripts && npm run lint:style",
"lint:scripts": "eslint src && tsc",
Expand Down
2 changes: 1 addition & 1 deletion src/api/apiAgencyLanguages.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { endpoints } from '../resources/scripts/endpoints';
import { fetchData, FETCH_METHODS, FETCH_SUCCESS } from './fetchData';

import { AgencyLanguagesInterface } from '../globalState';
import { AgencyLanguagesInterface } from '../globalState/interfaces';

export const apiAgencyLanguages = async (
agencyId: number,
Expand Down
2 changes: 1 addition & 1 deletion src/api/apiAgencySelection.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { endpoints } from '../resources/scripts/endpoints';
import { fetchData, FETCH_METHODS, FETCH_ERRORS } from './fetchData';
import { VALID_POSTCODE_LENGTH } from '../components/agencySelection/agencySelectionHelpers';
import { AgencyDataInterface } from '../globalState';
import { AgencyDataInterface } from '../globalState/interfaces';

export const apiAgencySelection = async (
params: {
Expand Down
2 changes: 1 addition & 1 deletion src/api/apiFrontendSettings.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { endpoints } from '../resources/scripts/endpoints';
import { fetchData, FETCH_METHODS } from './fetchData';
import { AppConfigInterface } from '../globalState';
import { AppConfigInterface } from '../globalState/interfaces';

export const apiFrontendSettings = async (): Promise<AppConfigInterface> =>
fetchData({
Expand Down
2 changes: 1 addition & 1 deletion src/api/apiGetAgencyId.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { endpoints } from '../resources/scripts/endpoints';
import { fetchData, FETCH_METHODS, FETCH_ERRORS } from './fetchData';
import { AgencyDataInterface } from '../globalState';
import { AgencyDataInterface } from '../globalState/interfaces';

export const apiGetAgencyById = async (
agencyId: any
Expand Down
2 changes: 1 addition & 1 deletion src/api/apiGetAppointmentsServiceBookingEventsByUserId.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { BookingEventsInterface } from '../globalState/interfaces/BookingsInterface';
import { BookingEventsInterface } from '../globalState/interfaces';
import { endpoints } from '../resources/scripts/endpoints';
import { fetchData, FETCH_METHODS } from './fetchData';

Expand Down
2 changes: 1 addition & 1 deletion src/api/apiGetChatRoomById.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { endpoints } from '../resources/scripts/endpoints';
import { fetchData, FETCH_METHODS, FETCH_ERRORS } from './fetchData';
import { ListItemInterface } from '../globalState';
import { ListItemInterface } from '../globalState/interfaces';

export const apiGetChatRoomById = async (
chatId: number,
Expand Down
2 changes: 1 addition & 1 deletion src/api/apiGetConsultant.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { endpoints } from '../resources/scripts/endpoints';
import { fetchData, FETCH_METHODS, FETCH_ERRORS } from './fetchData';
import { ConsultantDataInterface } from '../globalState';
import { ConsultantDataInterface } from '../globalState/interfaces';
import { apiGetConsultingType } from './apiGetConsultingType';
import { apiGetConsultingTypes } from './apiGetConsultingTypes';

Expand Down
2 changes: 1 addition & 1 deletion src/api/apiGetConsultantAppointments.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { BookingEventsInterface } from '../globalState/interfaces/BookingsInterface';
import { BookingEventsInterface } from '../globalState/interfaces';
import { endpoints } from '../resources/scripts/endpoints';
import { BookingsStatus } from '../utils/consultant';
import { fetchData, FETCH_METHODS } from './fetchData';
Expand Down
2 changes: 1 addition & 1 deletion src/api/apiGetConsultantSessionList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
SESSION_LIST_TAB_ARCHIVE,
SESSION_LIST_TYPES
} from '../components/session/sessionHelpers';
import { ListItemsResponseInterface } from '../globalState';
import { ListItemsResponseInterface } from '../globalState/interfaces';
import { FETCH_ERRORS, FETCH_METHODS, fetchData } from './fetchData';

export const INITIAL_FILTER: string = 'all';
Expand Down
2 changes: 1 addition & 1 deletion src/api/apiGetConsultingType.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ConsultingTypeInterface } from '../globalState';
import { ConsultingTypeInterface } from '../globalState/interfaces';
import { endpoints } from '../resources/scripts/endpoints';
import { fetchData, FETCH_ERRORS, FETCH_METHODS } from './fetchData';

Expand Down
2 changes: 1 addition & 1 deletion src/api/apiGetConsultingTypes.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ConsultingTypeBasicInterface } from '../globalState';
import { ConsultingTypeBasicInterface } from '../globalState/interfaces';
import { endpoints } from '../resources/scripts/endpoints';
import { fetchData, FETCH_METHODS } from './fetchData';

Expand Down
10 changes: 0 additions & 10 deletions src/api/apiGetGroupMembers.ts

This file was deleted.

2 changes: 1 addition & 1 deletion src/api/apiGetSessionRooms.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { endpoints } from '../resources/scripts/endpoints';
import { fetchData, FETCH_METHODS, FETCH_ERRORS } from './fetchData';
import { ListItemInterface } from '../globalState';
import { ListItemInterface } from '../globalState/interfaces';

export const apiGetSessionRoomsByGroupIds = async (
rcGroupIds: string[],
Expand Down
2 changes: 1 addition & 1 deletion src/api/apiGetTenantTheming.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { fetchData, FETCH_METHODS, FETCH_ERRORS } from './fetchData';
import { endpoints } from '../resources/scripts/endpoints';
import { TenantDataInterface } from '../globalState/interfaces/TenantDataInterface';
import { TenantDataInterface } from '../globalState/interfaces';

export const apiGetTenantTheming = async (): Promise<TenantDataInterface> => {
return fetchData({
Expand Down
2 changes: 1 addition & 1 deletion src/api/apiGetTools.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { APIToolsInterface } from '../globalState/interfaces/ToolsInterface';
import { APIToolsInterface } from '../globalState/interfaces';
import { endpoints } from '../resources/scripts/endpoints';
import { fetchData, FETCH_ERRORS, FETCH_METHODS } from './fetchData';

Expand Down
2 changes: 1 addition & 1 deletion src/api/apiGetTopicId.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { TopicsDataInterface } from '../globalState/interfaces/TopicsDataInterface';
import { TopicsDataInterface } from '../globalState/interfaces';
import { apiGetTopicsData } from './apiGetTopicsData';

export const apiGetTopicById = async (
Expand Down
2 changes: 1 addition & 1 deletion src/api/apiGetTopicsData.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { endpoints } from '../resources/scripts/endpoints';
import { fetchData, FETCH_ERRORS, FETCH_METHODS } from './fetchData';
import { TopicsDataInterface } from '../globalState/interfaces/TopicsDataInterface';
import { TopicsDataInterface } from '../globalState/interfaces';

export const apiGetTopicsData = async (): Promise<TopicsDataInterface[]> => {
const url = endpoints.topicsData;
Expand Down
2 changes: 1 addition & 1 deletion src/api/apiGetUserData.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { endpoints } from '../resources/scripts/endpoints';
import { UserDataInterface } from '../globalState';
import { UserDataInterface } from '../globalState/interfaces';
import { fetchData, FETCH_METHODS } from './fetchData';

export const apiGetUserData = async (
Expand Down
2 changes: 1 addition & 1 deletion src/api/apiGetUserDataBySessionId.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { endpoints } from '../resources/scripts/endpoints';
import { fetchData, FETCH_METHODS, FETCH_ERRORS } from './fetchData';
import { ConsultingSessionDataInterface } from '../globalState';
import { ConsultingSessionDataInterface } from '../globalState/interfaces';

export const apiGetUserDataBySessionId = async (
sessionId: number
Expand Down
2 changes: 1 addition & 1 deletion src/api/apiPostRegistration.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { autoLogin } from '../components/registration/autoLogin';
import { removeAllCookies } from '../components/sessionCookie/accessSessionCookie';
import { TenantDataInterface } from '../globalState/interfaces/TenantDataInterface';
import { TenantDataInterface } from '../globalState/interfaces';
import { FETCH_ERRORS, FETCH_METHODS, fetchData } from './fetchData';
import { COOKIE_KEY } from '../globalState';

Expand Down
2 changes: 1 addition & 1 deletion src/api/apiServerSettings.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { endpoints } from '../resources/scripts/endpoints';
import { fetchData, FETCH_METHODS } from './fetchData';
import { ServerAppConfigInterface } from '../globalState';
import { ServerAppConfigInterface } from '../globalState/interfaces';

export const apiServerSettings = async (): Promise<ServerAppConfigInterface> =>
fetchData({
Expand Down
2 changes: 1 addition & 1 deletion src/api/appointments/deleteAppointment.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { endpoints } from '../../resources/scripts/endpoints';
import { fetchData, FETCH_METHODS, FETCH_ERRORS } from './../fetchData';
import { AppointmentsDataInterface } from '../../globalState/interfaces/AppointmentsDataInterface';
import { AppointmentsDataInterface } from '../../globalState/interfaces';

export const deleteAppointment = async (
appointmentId: string
Expand Down
2 changes: 1 addition & 1 deletion src/api/appointments/getAppointment.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { AppointmentsDataInterface } from '../../globalState/interfaces/AppointmentsDataInterface';
import { AppointmentsDataInterface } from '../../globalState/interfaces';
import { endpoints } from '../../resources/scripts/endpoints';
import { FETCH_ERRORS, FETCH_METHODS, fetchData } from '../fetchData';

Expand Down
2 changes: 1 addition & 1 deletion src/api/appointments/getAppointments.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { AppointmentsDataInterface } from '../../globalState/interfaces/AppointmentsDataInterface';
import { AppointmentsDataInterface } from '../../globalState/interfaces';
import { endpoints } from '../../resources/scripts/endpoints';
import { FETCH_ERRORS, FETCH_METHODS, fetchData } from '../fetchData';

Expand Down
2 changes: 1 addition & 1 deletion src/api/appointments/postAppointments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { fetchData, FETCH_METHODS, FETCH_ERRORS } from './../fetchData';
import {
AppointmentsDataInterface,
STATUS_CREATED
} from '../../globalState/interfaces/AppointmentsDataInterface';
} from '../../globalState/interfaces';

export const postAppointments = async (
data: Partial<AppointmentsDataInterface>
Expand Down
2 changes: 1 addition & 1 deletion src/api/appointments/putAppointment.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { endpoints } from '../../resources/scripts/endpoints';
import { fetchData, FETCH_METHODS, FETCH_ERRORS } from './../fetchData';
import { AppointmentsDataInterface } from '../../globalState/interfaces/AppointmentsDataInterface';
import { AppointmentsDataInterface } from '../../globalState/interfaces';

export const putAppointment = async (
appointmentId: string,
Expand Down
2 changes: 1 addition & 1 deletion src/api/videocalls/getJwt.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { VideoCallJwtDataInterface } from '../../globalState/interfaces/VideoCallDataInterface';
import { VideoCallJwtDataInterface } from '../../globalState/interfaces';
import { endpoints } from '../../resources/scripts/endpoints';
import { FETCH_ERRORS, FETCH_METHODS, fetchData } from '../fetchData';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ import {
ConsultingTypesContext,
hasUserAuthority,
SessionsDataContext,
STATUS_EMPTY,
UserDataContext
} from '../../globalState';
import { STATUS_EMPTY } from '../../globalState/interfaces';
import { Link } from 'react-router-dom';

export const E2EEncryptionSupportBanner = () => {
Expand Down
2 changes: 1 addition & 1 deletion src/components/agencySelection/AgencyInfo.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react';
import { useEffect, useState } from 'react';
import { AgencyDataInterface } from '../../globalState';
import { AgencyDataInterface } from '../../globalState/interfaces';
import { ReactComponent as InfoIcon } from '../../resources/img/icons/i.svg';
import { isMobile } from 'react-device-detect';
import { Text } from '../text/Text';
Expand Down
7 changes: 3 additions & 4 deletions src/components/agencySelection/AgencySelection.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import * as React from 'react';
import { useEffect, useState } from 'react';
import { useLocaleData, useTenant } from '../../globalState';
import {
AgencyDataInterface,
ConsultingTypeBasicInterface,
useLocaleData,
useTenant
} from '../../globalState';
ConsultingTypeBasicInterface
} from '../../globalState/interfaces';
import { apiAgencySelection, FETCH_ERRORS } from '../../api';
import { InputField, InputFieldItem } from '../inputField/InputField';
import { VALID_POSTCODE_LENGTH } from './agencySelectionHelpers';
Expand Down
7 changes: 2 additions & 5 deletions src/components/app/RouterConfig.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,8 @@ import { CreateGroupChatView } from '../groupChat/CreateChatView';
import { GroupChatInfo } from '../groupChat/GroupChatInfo';
import { Appointments } from '../appointment/Appointments';
import VideoConference from '../videoConference/VideoConference';
import {
AppConfigInterface,
AUTHORITIES,
hasUserAuthority
} from '../../globalState';
import { AUTHORITIES, hasUserAuthority } from '../../globalState';
import { AppConfigInterface } from '../../globalState/interfaces';

import { ReactComponent as OverviewIconOutline } from '../../resources/img/icons/overview_outline.svg';
import { ReactComponent as OverviewIconFilled } from '../../resources/img/icons/overview_filled.svg';
Expand Down
Loading

0 comments on commit ad8fcc8

Please sign in to comment.