Separate common interfaces from client-specific classes
Changes:
- Move client-specific classes to client/src/models
- Extract common interface to standalone files in common/interfaces
- Remove unused features from client-specific classes
- These are features which were once used on the old server, but are now no longer needed
- Remove getObject() method for Account, Contact, and Conversation
- Remove lookups, registrationState and registeringName from Account
- Remove resolving logic from Contact
- Remove requests and listeners from Conversation (once used for Socket.IO and promises on server)
- Rename services/Conversation.ts to services/conversationQueries.ts
- Update imports
Future work:
- Create interface versions of Account, Contact, and Conversation
- Create new interfaces to replace Records on server
GitLab: #94
Change-Id: Ia51fe6ebeda44a30887d851a5564569dc290e5ed
diff --git a/common/src/interfaces/message.ts b/common/src/interfaces/message.ts
new file mode 100644
index 0000000..1596145
--- /dev/null
+++ b/common/src/interfaces/message.ts
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2022 Savoir-faire Linux Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation; either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public
+ * License along with this program. If not, see
+ * <https://www.gnu.org/licenses/>.
+ */
+export interface Message {
+ id: string;
+ author: string;
+ timestamp: string;
+ type:
+ | 'application/call-history+json'
+ | 'application/data-transfer+json'
+ | 'application/update-profile'
+ | 'initial'
+ | 'member'
+ | 'merge'
+ | 'text/plain'
+ | 'vote';
+ linearizedParent: string;
+ parents: string;
+ body?: string;
+ duration?: string;
+ to?: string;
+ invited?: string;
+}