Add `common` subproject containing shared files

Move classes in `model` to their own `common` package.
Now, the client and server can import `common` as a library.
This is the first step to eventually migrate all the source code at the root of the
project to an `old-server` package.

GitLab: #55
Change-Id: I4b7a52e80171d9c3399416ab524bcdd6915ac540
diff --git a/client/package.json b/client/package.json
index f75fe9c..3285f86 100644
--- a/client/package.json
+++ b/client/package.json
@@ -39,6 +39,7 @@
     "emoji-picker-react": "^3.6.1",
     "framer-motion": "^7.3.5",
     "i18next": "^21.9.2",
+    "jami-web-common": "file:../common",
     "qrcode.react": "^3.1.0",
     "react": "^18.2.0",
     "react-dom": "^18.2.0",
diff --git a/client/redux/appSlice.ts b/client/redux/appSlice.ts
index c85ebd7..030a45a 100644
--- a/client/redux/appSlice.ts
+++ b/client/redux/appSlice.ts
@@ -16,8 +16,7 @@
  * <https://www.gnu.org/licenses/>.
  */
 import { createSlice, PayloadAction } from '@reduxjs/toolkit';
-
-import Account from '../../model/Account';
+import { Account } from 'jami-web-common';
 
 // Define a type for the slice state
 interface appState {
diff --git a/client/src/AuthManager.ts b/client/src/AuthManager.ts
index 2cd0279..29c5ffc 100644
--- a/client/src/AuthManager.ts
+++ b/client/src/AuthManager.ts
@@ -19,7 +19,7 @@
 /* eslint-disable no-undef */
 // TODO: This hides eslint errors for this file. This should be removed once this file is cleaned up.
 
-import { PromiseExecutor } from '../../model/util';
+import { PromiseExecutor } from 'jami-web-common';
 
 interface AuthManagerState {
   initialized: boolean;
diff --git a/client/src/components/AccountPreferences.tsx b/client/src/components/AccountPreferences.tsx
index cfbc0ec..db3e62d 100644
--- a/client/src/components/AccountPreferences.tsx
+++ b/client/src/components/AccountPreferences.tsx
@@ -35,10 +35,10 @@
   Typography,
 } from '@mui/material';
 import { motion } from 'framer-motion';
+import { Account } from 'jami-web-common';
+import { AccountDetails } from 'jami-web-common';
 import { useState } from 'react';
 
-import Account from '../../../model/Account';
-import AccountDetails from '../../../model/AccountDetails';
 import authManager from '../AuthManager';
 import ConversationAvatar from './ConversationAvatar';
 import ConversationsOverviewCard from './ConversationsOverviewCard';
diff --git a/client/src/components/ConversationList.tsx b/client/src/components/ConversationList.tsx
index f53aed8..b70001a 100644
--- a/client/src/components/ConversationList.tsx
+++ b/client/src/components/ConversationList.tsx
@@ -19,9 +19,9 @@
 import List from '@mui/material/List';
 import ListSubheader from '@mui/material/ListSubheader';
 import Typography from '@mui/material/Typography';
+import { Conversation } from 'jami-web-common';
 import { useEffect } from 'react';
 
-import Conversation from '../../../model/Conversation';
 import { useAppSelector } from '../../redux/hooks';
 import ConversationListItem from './ConversationListItem';
 
diff --git a/client/src/components/ConversationListItem.js b/client/src/components/ConversationListItem.js
index 9c85733..0bcb0b3 100644
--- a/client/src/components/ConversationListItem.js
+++ b/client/src/components/ConversationListItem.js
@@ -16,12 +16,12 @@
  * <https://www.gnu.org/licenses/>.
  */
 import { Box, ListItem, ListItemAvatar, ListItemText, Stack, Typography } from '@mui/material';
+import { Conversation } from 'jami-web-common';
 import { QRCodeCanvas } from 'qrcode.react';
 import { useState } from 'react';
 import Modal from 'react-modal';
 import { useNavigate, useParams } from 'react-router-dom';
 
-import Conversation from '../../../model/Conversation';
 import { setRefreshFromSlice } from '../../redux/appSlice';
 import { useAppDispatch } from '../../redux/hooks';
 import authManager from '../AuthManager';
diff --git a/client/src/components/ConversationView.tsx b/client/src/components/ConversationView.tsx
index e96b3f8..0a8e22d 100644
--- a/client/src/components/ConversationView.tsx
+++ b/client/src/components/ConversationView.tsx
@@ -16,9 +16,9 @@
  * <https://www.gnu.org/licenses/>.
  */
 import { Box, Stack, Typography } from '@mui/material';
+import { Conversation, Message } from 'jami-web-common';
 import { useCallback, useContext, useEffect, useState } from 'react';
 
-import Conversation, { Message } from '../../../model/Conversation';
 import { SocketContext } from '../contexts/Socket';
 import { useConversationQuery, useMessagesQuery, useSendMessageMutation } from '../services/Conversation';
 import ConversationAvatar from './ConversationAvatar';
diff --git a/client/src/components/ConversationsOverviewCard.js b/client/src/components/ConversationsOverviewCard.js
index b4206d5..6bb9dce 100644
--- a/client/src/components/ConversationsOverviewCard.js
+++ b/client/src/components/ConversationsOverviewCard.js
@@ -16,10 +16,10 @@
  * <https://www.gnu.org/licenses/>.
  */
 import { Card, CardActionArea, CardContent, CircularProgress, Typography } from '@mui/material';
+import { Conversation } from 'jami-web-common';
 import { useEffect, useState } from 'react';
 import { useNavigate, useParams } from 'react-router';
 
-import Conversation from '../../../model/Conversation';
 import authManager from '../AuthManager';
 
 export default function ConversationsOverviewCard(props) {
diff --git a/client/src/components/JamiIdCard.tsx b/client/src/components/JamiIdCard.tsx
index 1000cf9..6a3be3c 100644
--- a/client/src/components/JamiIdCard.tsx
+++ b/client/src/components/JamiIdCard.tsx
@@ -16,8 +16,7 @@
  * <https://www.gnu.org/licenses/>.
  */
 import { Box, Card, CardContent, Typography } from '@mui/material';
-
-import Account from '../../../model/Account';
+import { Account } from 'jami-web-common';
 
 type JamiIdCardProps = {
   account: Account;
diff --git a/client/src/pages/AccountSelection.tsx b/client/src/pages/AccountSelection.tsx
index 86e0591..35aed97 100644
--- a/client/src/pages/AccountSelection.tsx
+++ b/client/src/pages/AccountSelection.tsx
@@ -18,10 +18,10 @@
 import { AddRounded } from '@mui/icons-material';
 import { Avatar, Card, CardHeader, Container, List } from '@mui/material';
 import { motion } from 'framer-motion';
+import { Account } from 'jami-web-common';
 import { Fragment, useEffect, useState } from 'react';
 import { useNavigate } from 'react-router';
 
-import Account from '../../../model/Account';
 import authManager from '../AuthManager';
 import ConversationAvatar from '../components/ConversationAvatar';
 import Header from '../components/Header';
diff --git a/client/src/pages/AccountSettings.tsx b/client/src/pages/AccountSettings.tsx
index da631d3..35c0678 100644
--- a/client/src/pages/AccountSettings.tsx
+++ b/client/src/pages/AccountSettings.tsx
@@ -16,10 +16,10 @@
  * <https://www.gnu.org/licenses/>.
  */
 import { CircularProgress, Container } from '@mui/material';
+import { Account } from 'jami-web-common';
 import { useEffect, useState } from 'react';
 import { useParams } from 'react-router';
 
-import Account from '../../../model/Account';
 import { setAccountId, setAccountObject } from '../../redux/appSlice';
 import { useAppDispatch } from '../../redux/hooks';
 import authManager from '../AuthManager';
diff --git a/client/src/pages/Messenger.tsx b/client/src/pages/Messenger.tsx
index fa10cfd..1fd2252 100644
--- a/client/src/pages/Messenger.tsx
+++ b/client/src/pages/Messenger.tsx
@@ -16,11 +16,10 @@
  * <https://www.gnu.org/licenses/>.
  */
 import { Stack } from '@mui/material';
+import { Contact, Conversation } from 'jami-web-common';
 import { useEffect, useState } from 'react';
 import { useParams } from 'react-router';
 
-import Contact from '../../../model/Contact';
-import Conversation from '../../../model/Conversation';
 import { useAppSelector } from '../../redux/hooks';
 import authManager from '../AuthManager';
 //import Sound from 'react-sound';
diff --git a/client/src/pages/ServerConfiguration.tsx b/client/src/pages/ServerConfiguration.tsx
index 99e7547..56d06a8 100644
--- a/client/src/pages/ServerConfiguration.tsx
+++ b/client/src/pages/ServerConfiguration.tsx
@@ -17,10 +17,10 @@
  */
 import CircularProgress from '@mui/material/CircularProgress';
 import Container from '@mui/material/Container';
+import { Account } from 'jami-web-common';
 import { useEffect, useState } from 'react';
 import { useParams } from 'react-router-dom';
 
-import Account from '../../../model/Account';
 import authManager from '../AuthManager';
 import AccountPreferences from '../components/AccountPreferences';
 import Header from '../components/Header';