Skip to content

Privacy-first password manager with built-in email aliasing. Fully encrypted and self-hostable.

Update mobile app to use shared webapi models (#900)

Leendert de Borste8ba964064cd
diff --git a/apps/mobile-app/app/(tabs)/credentials/add-edit.tsx b/apps/mobile-app/app/(tabs)/credentials/add-edit.tsx
index d87acd699..c005e44b2 100644
--- a/apps/mobile-app/app/(tabs)/credentials/add-edit.tsx
+++ b/apps/mobile-app/app/(tabs)/credentials/add-edit.tsx
@@ -9,10 +9,10 @@ import { KeyboardAwareScrollView } from 'react-native-keyboard-aware-scroll-view
import Toast from 'react-native-toast-message';
import emitter from '@/utils/EventEmitter';
-import { CreateIdentityGenerator, IdentityHelperUtils, IIdentityGenerator } from '@/utils/shared/identity-generator';
+import { CreateIdentityGenerator, IdentityHelperUtils, IdentityGenerator } from '@/utils/shared/identity-generator';
+import type { FaviconExtractModel } from '@/utils/shared/models';
import { CreatePasswordGenerator, PasswordGenerator } from '@/utils/shared/password-generator';
import { Credential } from '@/utils/types/Credential';
-import { FaviconExtractModel } from '@/utils/types/webapi/FaviconExtractModel';
import { extractServiceNameFromUrl } from '@/utils/UrlUtility';
import { credentialSchema } from '@/utils/ValidationSchema';
@@ -135,9 +135,9 @@ export default function AddEditCredentialScreen() : React.ReactNode {
/**
* Initialize the identity and password generators with settings from user's vault.
- * @returns {identityGenerator: IIdentityGenerator, passwordGenerator: PasswordGenerator}
+ * @returns {identityGenerator: IdentityGenerator, passwordGenerator: PasswordGenerator}
*/
- const initializeGenerators = useCallback(async () : Promise<{ identityGenerator: IIdentityGenerator, passwordGenerator: PasswordGenerator }> => {
+ const initializeGenerators = useCallback(async () : Promise<{ identityGenerator: IdentityGenerator, passwordGenerator: PasswordGenerator }> => {
// Get default identity language from database
const identityLanguage = await dbContext.sqliteClient!.getDefaultIdentityLanguage();
diff --git a/apps/mobile-app/app/(tabs)/emails/[id].tsx b/apps/mobile-app/app/(tabs)/emails/[id].tsx
index 4b43b85f5..9aa4ac201 100644
--- a/apps/mobile-app/app/(tabs)/emails/[id].tsx
+++ b/apps/mobile-app/app/(tabs)/emails/[id].tsx
@@ -7,8 +7,8 @@ import { WebView } from 'react-native-webview';
import EncryptionUtility from '@/utils/EncryptionUtility';
import emitter from '@/utils/EventEmitter';
-import { Credential } from '@/utils/types/Credential';
-import { Email } from '@/utils/types/webapi/Email';
+import type { Email } from '@/utils/shared/models';
+import type { Credential } from '@/utils/types/Credential';
import { useColors } from '@/hooks/useColorScheme';
diff --git a/apps/mobile-app/app/(tabs)/emails/index.tsx b/apps/mobile-app/app/(tabs)/emails/index.tsx
index d4cfdd8d0..f8961530c 100644
--- a/apps/mobile-app/app/(tabs)/emails/index.tsx
+++ b/apps/mobile-app/app/(tabs)/emails/index.tsx
@@ -7,8 +7,7 @@ import Toast from 'react-native-toast-message';
import EncryptionUtility from '@/utils/EncryptionUtility';
import emitter from '@/utils/EventEmitter';
-import { MailboxBulkRequest, MailboxBulkResponse } from '@/utils/types/webapi/MailboxBulk';
-import { MailboxEmail } from '@/utils/types/webapi/MailboxEmail';
+import type { MailboxBulkRequest, MailboxBulkResponse, MailboxEmail } from '@/utils/shared/models';
import { useColors } from '@/hooks/useColorScheme';
import { useMinDurationLoading } from '@/hooks/useMinDurationLoading';
diff --git a/apps/mobile-app/app/(tabs)/settings/security/active-sessions.tsx b/apps/mobile-app/app/(tabs)/settings/security/active-sessions.tsx
index c235a3679..3349e7032 100644
--- a/apps/mobile-app/app/(tabs)/settings/security/active-sessions.tsx
+++ b/apps/mobile-app/app/(tabs)/settings/security/active-sessions.tsx
@@ -3,7 +3,7 @@ import { useState, useEffect, useCallback } from 'react';
import { StyleSheet, View, TouchableOpacity, Alert, RefreshControl, Platform } from 'react-native';
import Toast from 'react-native-toast-message';
-import { RefreshToken } from '@/utils/types/webapi/RefreshToken';
+import type { RefreshToken } from '@/utils/shared/models';
import { useColors } from '@/hooks/useColorScheme';
import { useMinDurationLoading } from '@/hooks/useMinDurationLoading';
diff --git a/apps/mobile-app/app/(tabs)/settings/security/auth-logs.tsx b/apps/mobile-app/app/(tabs)/settings/security/auth-logs.tsx
index bce5c3dce..156f04041 100644
--- a/apps/mobile-app/app/(tabs)/settings/security/auth-logs.tsx
+++ b/apps/mobile-app/app/(tabs)/settings/security/auth-logs.tsx
@@ -3,8 +3,8 @@ import { useState, useEffect, useCallback } from 'react';
import { StyleSheet, View, RefreshControl, Platform } from 'react-native';
import Toast from 'react-native-toast-message';
-import { AuthEventType } from '@/utils/types/webapi/AuthEventType';
-import { AuthLogModel } from '@/utils/types/webapi/AuthLog';
+import type { AuthLogModel } from '@/utils/shared/models';
+import { AuthEventType } from '@/utils/shared/models';
import { useColors } from '@/hooks/useColorScheme';
import { useMinDurationLoading } from '@/hooks/useMinDurationLoading';
diff --git a/apps/mobile-app/app/(tabs)/settings/security/delete-account.tsx b/apps/mobile-app/app/(tabs)/settings/security/delete-account.tsx
index 45a356efc..faa727cab 100644
--- a/apps/mobile-app/app/(tabs)/settings/security/delete-account.tsx
+++ b/apps/mobile-app/app/(tabs)/settings/security/delete-account.tsx
@@ -3,8 +3,7 @@ import { useState } from 'react';
import { StyleSheet, View, Alert, KeyboardAvoidingView, Platform } from 'react-native';
import srp from 'secure-remote-password/client';
-import { DeleteAccountInitiateRequest, DeleteAccountInitiateResponse } from '@/utils/types/webapi/DeleteAccountInitiate';
-import { DeleteAccountRequest } from '@/utils/types/webapi/DeleteAccountRequest';
+import type { DeleteAccountInitiateRequest, DeleteAccountInitiateResponse, DeleteAccountRequest } from '@/utils/shared/models';
import { useColors } from '@/hooks/useColorScheme';
diff --git a/apps/mobile-app/app/login.tsx b/apps/mobile-app/app/login.tsx
index d894d5cee..4f288125a 100644
--- a/apps/mobile-app/app/login.tsx
+++ b/apps/mobile-app/app/login.tsx
@@ -11,11 +11,10 @@ import { StyleSheet, View, Text, SafeAreaView, TextInput, TouchableOpacity, Acti
import { AppInfo } from '@/utils/AppInfo';
import ConversionUtility from '@/utils/ConversionUtility';
import EncryptionUtility from '@/utils/EncryptionUtility';
+import type { LoginResponse, VaultResponse } from '@/utils/shared/models';
import { SrpUtility } from '@/utils/SrpUtility';
import { ApiAuthError } from '@/utils/types/errors/ApiAuthError';
import { EncryptionKeyDerivationParams } from '@/utils/types/messaging/EncryptionKeyDerivationParams';
-import { LoginResponse } from '@/utils/types/webapi/Login';
-import { VaultResponse } from '@/utils/types/webapi/VaultResponse';
import { useColors } from '@/hooks/useColorScheme';
import { useVaultSync } from '@/hooks/useVaultSync';
diff --git a/apps/mobile-app/components/EmailCard.tsx b/apps/mobile-app/components/EmailCard.tsx
index ba231f087..fdcac3a12 100644
--- a/apps/mobile-app/components/EmailCard.tsx
+++ b/apps/mobile-app/components/EmailCard.tsx
@@ -2,8 +2,8 @@ import { router } from 'expo-router';
import { useEffect, useState } from 'react';
import { StyleSheet, View, TouchableOpacity } from 'react-native';
+import type { MailboxEmail } from '@/utils/shared/models';
import { Credential } from '@/utils/types/Credential';
-import { MailboxEmail } from '@/utils/types/webapi/MailboxEmail';
import { useColors } from '@/hooks/useColorScheme';
diff --git a/apps/mobile-app/components/credentials/details/EmailPreview.tsx b/apps/mobile-app/components/credentials/details/EmailPreview.tsx
index bcd8e1c41..5d5bc499e 100644
--- a/apps/mobile-app/components/credentials/details/EmailPreview.tsx
+++ b/apps/mobile-app/components/credentials/details/EmailPreview.tsx
@@ -5,8 +5,7 @@ import { View, StyleSheet, TouchableOpacity, Linking, AppState } from 'react-nat
import { AppInfo } from '@/utils/AppInfo';
import EncryptionUtility from '@/utils/EncryptionUtility';
-import { MailboxBulkRequest, MailboxBulkResponse } from '@/utils/types/webapi/MailboxBulk';
-import { MailboxEmail } from '@/utils/types/webapi/MailboxEmail';
+import type { MailboxBulkRequest, MailboxBulkResponse, MailboxEmail } from '@/utils/shared/models';
import { useColors } from '@/hooks/useColorScheme';
diff --git a/apps/mobile-app/context/DbContext.tsx b/apps/mobile-app/context/DbContext.tsx
index c711ef1de..6648e72b3 100644
--- a/apps/mobile-app/context/DbContext.tsx
+++ b/apps/mobile-app/context/DbContext.tsx
@@ -1,9 +1,9 @@
import React, { createContext, useContext, useState, useEffect, useCallback, useMemo } from 'react';
+import type { VaultResponse } from '@/utils/shared/models';
import SqliteClient from '@/utils/SqliteClient';
import { EncryptionKeyDerivationParams } from '@/utils/types/messaging/EncryptionKeyDerivationParams';
import { VaultMetadata } from '@/utils/types/messaging/VaultMetadata';
-import { VaultResponse } from '@/utils/types/webapi/VaultResponse';
import NativeVaultManager from '@/specs/NativeVaultManager';
diff --git a/apps/mobile-app/hooks/useVaultMutate.ts b/apps/mobile-app/hooks/useVaultMutate.ts
index 42115c2bf..f5180153f 100644
--- a/apps/mobile-app/hooks/useVaultMutate.ts
+++ b/apps/mobile-app/hooks/useVaultMutate.ts
@@ -3,10 +3,8 @@ import Toast from 'react-native-toast-message';
import srp from 'secure-remote-password/client';
import EncryptionUtility from '@/utils/EncryptionUtility';
+import type { PasswordChangeInitiateResponse, Vault, VaultPasswordChangeRequest } from '@/utils/shared/models';
import { EncryptionKeyDerivationParams } from '@/utils/types/messaging/EncryptionKeyDerivationParams';
-import { PasswordChangeInitiateResponse } from '@/utils/types/webapi/PasswordChangeInitiateResponse';
-import { Vault } from '@/utils/types/webapi/Vault';
-import { VaultPasswordChangeRequest } from '@/utils/types/webapi/VaultPasswordChangeRequest';
import { useVaultSync } from '@/hooks/useVaultSync';
diff --git a/apps/mobile-app/hooks/useVaultSync.ts b/apps/mobile-app/hooks/useVaultSync.ts
index 7be7d4653..ed00aac2d 100644
--- a/apps/mobile-app/hooks/useVaultSync.ts
+++ b/apps/mobile-app/hooks/useVaultSync.ts
@@ -1,7 +1,7 @@
import { useCallback } from 'react';
import { AppInfo } from '@/utils/AppInfo';
-import { VaultResponse } from '@/utils/types/webapi/VaultResponse';
+import type { VaultResponse } from '@/utils/shared/models';
import { useAuth } from '@/context/AuthContext';
import { useDb } from '@/context/DbContext';
diff --git a/apps/mobile-app/utils/EncryptionUtility.tsx b/apps/mobile-app/utils/EncryptionUtility.tsx
index 7a6b847d9..0fc6f0a32 100644
--- a/apps/mobile-app/utils/EncryptionUtility.tsx
+++ b/apps/mobile-app/utils/EncryptionUtility.tsx
@@ -3,9 +3,9 @@ import { Buffer } from 'buffer';
import AesGcmCrypto from 'react-native-aes-gcm-crypto';
import argon2 from 'react-native-argon2';
+import type { Email, MailboxEmail } from '@/utils/shared/models';
+
import { EncryptionKey } from './types/EncryptionKey';
-import { Email } from './types/webapi/Email';
-import { MailboxEmail } from './types/webapi/MailboxEmail';
/**
* Utility class for encryption operations including:
diff --git a/apps/mobile-app/utils/SrpUtility.tsx b/apps/mobile-app/utils/SrpUtility.tsx
index 292b4f82f..24f39defd 100644
--- a/apps/mobile-app/utils/SrpUtility.tsx
+++ b/apps/mobile-app/utils/SrpUtility.tsx
@@ -1,9 +1,7 @@
import srp from 'secure-remote-password/client';
+import type { BadRequestResponse, LoginResponse, ValidateLoginRequest2Fa, ValidateLoginResponse } from '@/utils/shared/models';
import { ApiAuthError } from '@/utils/types/errors/ApiAuthError';
-import BadRequestResponse from '@/utils/types/webapi/BadRequestResponse';
-import { LoginResponse } from '@/utils/types/webapi/Login';
-import { ValidateLoginRequest2Fa, ValidateLoginResponse } from '@/utils/types/webapi/ValidateLogin';
import { WebApiService } from '@/utils/WebApiService';
/**
diff --git a/apps/mobile-app/utils/WebApiService.ts b/apps/mobile-app/utils/WebApiService.ts
index 5fcad1930..4a9167304 100644
--- a/apps/mobile-app/utils/WebApiService.ts
+++ b/apps/mobile-app/utils/WebApiService.ts
@@ -1,11 +1,7 @@
import AsyncStorage from '@react-native-async-storage/async-storage';
import { AppInfo } from '@/utils/AppInfo';
-import { StatusResponse } from '@/utils/types/webapi/StatusResponse';
-import { VaultResponse } from '@/utils/types/webapi/VaultResponse';
-
-import { AuthLogModel } from './types/webapi/AuthLog';
-import { RefreshToken } from './types/webapi/RefreshToken';
+import type { StatusResponse, VaultResponse, AuthLogModel, RefreshToken } from '@/utils/shared/models';
type RequestInit = globalThis.RequestInit;
diff --git a/apps/mobile-app/utils/shared/models/README.md b/apps/mobile-app/utils/shared/models/README.md
new file mode 100644
index 000000000..57e908a5a
--- /dev/null
+++ b/apps/mobile-app/utils/shared/models/README.md
@@ -0,0 +1,9 @@
+# ⚠️ Auto-Generated Files
+
+This folder contains the output of the shared `models` module from the `/shared` directory in the AliasVault project.
+
+**Do not edit any of these files manually.**
+
+To make changes:
+1. Update the source files in the `/shared/models/src` directory
+2. Run the `build.sh` script in the module directory to regenerate the outputs and copy them here.
diff --git a/apps/mobile-app/utils/shared/models/index.d.ts b/apps/mobile-app/utils/shared/models/index.d.ts
new file mode 100644
index 000000000..0065eeafb
--- /dev/null
+++ b/apps/mobile-app/utils/shared/models/index.d.ts
@@ -0,0 +1,310 @@
+/**
+ * Vault type.
+ */
+type Vault = {
+ blob: string;
+ createdAt: string;
+ credentialsCount: number;
+ currentRevisionNumber: number;
+ emailAddressList: string[];
+ privateEmailDomainList: string[];
+ publicEmailDomainList: string[];
+ encryptionPublicKey: string;
+ updatedAt: string;
+ username: string;
+ version: string;
+ client: string;
+};
+
+/**
+ * Vault response type.
+ */
+type VaultResponse = {
+ status: number;
+ vault: Vault;
+};
+
+/**
+ * Vault post response type returned after uploading a new vault to the server.
+ */
+type VaultPostResponse = {
+ status: number;
+ newRevisionNumber: number;
+};
+
+/**
+ * Status response type.
+ */
+type StatusResponse = {
+ clientVersionSupported: boolean;
+ serverVersion: string;
+ vaultRevision: number;
+};
+
+/**
+ * Login request type.
+ */
+type LoginRequest = {
+ username: string;
+};
+/**
+ * Login response type.
+ */
+type LoginResponse = {
+ salt: string;
+ serverEphemeral: string;
+ encryptionType: string;
+ encryptionSettings: string;
+};
+
+/**
+ * Validate login request type.
+ */
+type ValidateLoginRequest = {
+ username: string;
+ rememberMe: boolean;
+ clientPublicEphemeral: string;
+ clientSessionProof: string;
+};
+/**
+ * Validate login request type for 2FA.
+ */
+type ValidateLoginRequest2Fa = {
+ username: string;
+ code2Fa: number;
+ rememberMe: boolean;
+ clientPublicEphemeral: string;
+ clientSessionProof: string;
+};
+/**
+ * Validate login response type.
+ */
+type ValidateLoginResponse = {
+ requiresTwoFactor: boolean;
+ token?: {
+ token: string;
+ refreshToken: string;
+ };
+ serverSessionProof: string;
+};
+
+type MailboxEmail = {
+ /** The preview of the email message */
+ messagePreview: string;
+ /** Indicates whether the email has attachments */
+ hasAttachments: boolean;
+ /** The ID of the email */
+ id: number;
+ /** The subject of the email */
+ subject: string;
+ /** The display name of the sender */
+ fromDisplay: string;
+ /** The domain of the sender's email address */
+ fromDomain: string;
+ /** The local part of the sender's email address */
+ fromLocal: string;
+ /** The domain of the recipient's email address */
+ toDomain: string;
+ /** The local part of the recipient's email address */
+ toLocal: string;
+ /** The date of the email */
+ date: string;
+ /** The system date of the email */
+ dateSystem: string;
+ /** The number of seconds ago the email was received */
+ secondsAgo: number;
+ /**
+ * The encrypted symmetric key which was used to encrypt the email message.
+ * This key is encrypted with the public key of the user.
+ */
+ encryptedSymmetricKey: string;
+ /** The public key of the user used to encrypt the symmetric key */
+ encryptionKey: string;
+};
+
+/**
+ * Mailbox bulk request type.
+ */
+type MailboxBulkRequest = {
+ addresses: string[];
+ page: number;
+ pageSize: number;
+};
+/**
+ * Mailbox bulk response type.
+ */
+type MailboxBulkResponse = {
+ addresses: string[];
+ currentPage: number;
+ pageSize: number;
+ totalRecords: number;
+ mails: MailboxEmail[];
+};
+
+/**
+ * Email attachment type.
+ */
+type Attachment = {
+ /** The ID of the attachment */
+ id: number;
+ /** The ID of the email the attachment belongs to */
+ emailId: number;
+ /** The filename of the attachment */
+ filename: string;
+ /** The MIME type of the attachment */
+ mimeType: string;
+ /** The size of the attachment in bytes */
+ filesize: number;
+};
+
+type Email = {
+ /** The body of the email message */
+ messageHtml: string;
+ /** The plain text body of the email message */
+ messagePlain: string;
+ /** The ID of the email */
+ id: number;
+ /** The subject of the email */
+ subject: string;
+ /** The display name of the sender */
+ fromDisplay: string;
+ /** The domain of the sender's email address */
+ fromDomain: string;
+ /** The local part of the sender's email address */
+ fromLocal: string;
+ /** The domain of the recipient's email address */
+ toDomain: string;
+ /** The local part of the recipient's email address */
+ toLocal: string;
+ /** The date of the email */
+ date: string;
+ /** The system date of the email */
+ dateSystem: string;
+ /** The number of seconds ago the email was received */
+ secondsAgo: number;
+ /**
+ * The encrypted symmetric key which was used to encrypt the email message.
+ * This key is encrypted with the public key of the user.
+ */
+ encryptedSymmetricKey: string;
+ /** The public key of the user used to encrypt the symmetric key */
+ encryptionKey: string;
+ /** The attachments of the email */
+ attachments: Attachment[];
+};
+
+/**
+ * Auth Log model.
+ */
+type AuthLogModel = {
+ /**
+ * Gets or sets the primary key for the auth log entry.
+ */
+ id: number;
+ /**
+ * Gets or sets the timestamp of the auth log entry.
+ */
+ timestamp: string;
+ /**
+ * Gets or sets the type of authentication event.
+ */
+ eventType: number;
+ /**
+ * Gets or sets the username associated with the auth log entry.
+ */
+ username: string;
+ /**
+ * Gets or sets the IP address from which the authentication attempt was made.
+ */
+ ipAddress: string;
+ /**
+ * Gets or sets the user agent string of the device used for the authentication attempt.
+ */
+ userAgent: string;
+ /**
+ * Gets or sets the client application name and version.
+ */
+ client: string;
+ /**
+ * Gets or sets a value indicating whether the authentication attempt was successful.
+ */
+ isSuccess: boolean;
+};
+
+type RefreshToken = {
+ /**
+ * Gets or sets the unique identifier for the refresh token.
+ */
+ id: string;
+ /**
+ * Gets or sets the device identifier associated with the refresh token.
+ */
+ deviceIdentifier: string;
+ /**
+ * Gets or sets the expiration date of the refresh token.
+ */
+ expireDate: string;
+ /**
+ * Gets or sets the creation date of the refresh token.
+ */
+ createdAt: string;
+};
+
+type FaviconExtractModel = {
+ image: string | null;
+};
+
+/**
+ * Represents a delete account initiate response.
+ */
+type DeleteAccountInitiateRequest = {
+ username: string;
+};
+/**
+ * Represents a delete account initiate response.
+ */
+type DeleteAccountInitiateResponse = {
+ salt: string;
+ serverEphemeral: string;
+ encryptionType: string;
+ encryptionSettings: string;
+};
+
+/**
+ * Represents a delete account request.
+ */
+type DeleteAccountRequest = {
+ username: string;
+ clientPublicEphemeral: string;
+ clientSessionProof: string;
+};
+
+/**
+ * Represents a password change initiate response.
+ */
+type PasswordChangeInitiateResponse = {
+ salt: string;
+ serverEphemeral: string;
+ encryptionType: string;
+ encryptionSettings: string;
+};
+
+/**
+ * Represents a request to change the users password including a new vault that is encrypted with the new password.
+ */
+type VaultPasswordChangeRequest = Vault & {
+ currentClientPublicEphemeral: string;
+ currentClientSessionProof: string;
+ newPasswordSalt: string;
+ newPasswordVerifier: string;
+};
+
+type BadRequestResponse = {
+ type: string;
+ title: string;
+ status: number;
+ errors: Record<string, string[]>;
+ traceId: string;
+};
+
+export type { Attachment, AuthLogModel, BadRequestResponse, DeleteAccountInitiateRequest, DeleteAccountInitiateResponse, DeleteAccountRequest, Email, FaviconExtractModel, LoginRequest, LoginResponse, MailboxBulkRequest, MailboxBulkResponse, MailboxEmail, PasswordChangeInitiateResponse, RefreshToken, StatusResponse, ValidateLoginRequest, ValidateLoginRequest2Fa, ValidateLoginResponse, Vault, VaultPasswordChangeRequest, VaultPostResponse, VaultResponse };
diff --git a/apps/mobile-app/utils/shared/models/index.js b/apps/mobile-app/utils/shared/models/index.js
new file mode 100644
index 000000000..a41e52c7b
--- /dev/null
+++ b/apps/mobile-app/utils/shared/models/index.js
@@ -0,0 +1,3 @@
+
+//# sourceMappingURL=index.js.map
+//# sourceMappingURL=index.js.map
\ No newline at end of file
diff --git a/apps/mobile-app/utils/types/webapi/Attachment.ts b/apps/mobile-app/utils/types/webapi/Attachment.ts
deleted file mode 100644
index cd74065fe..000000000
--- a/apps/mobile-app/utils/types/webapi/Attachment.ts
+++ /dev/null
@@ -1,19 +0,0 @@
-/**
- * Email attachment type.
- */
-export type Attachment = {
- /** The ID of the attachment */
- id: number;
-
- /** The ID of the email the attachment belongs to */
- emailId: number;
-
- /** The filename of the attachment */
- filename: string;
-
- /** The MIME type of the attachment */
- mimeType: string;
-
- /** The size of the attachment in bytes */
- filesize: number;
-}
\ No newline at end of file
diff --git a/apps/mobile-app/utils/types/webapi/AuthEventType.ts b/apps/mobile-app/utils/types/webapi/AuthEventType.ts
deleted file mode 100644
index bd200c404..000000000
--- a/apps/mobile-app/utils/types/webapi/AuthEventType.ts
+++ /dev/null
@@ -1,54 +0,0 @@
-/**
- * Represents the type of authentication event.
- */
-export enum AuthEventType {
- /**
- * Represents a standard login attempt.
- */
- Login = 1,
-
- /**
- * Represents a two-factor authentication attempt.
- */
- TwoFactorAuthentication = 2,
-
- /**
- * Represents a user logout event.
- */
- Logout = 3,
-
- /**
- * Represents JWT access token refresh event issued by client to API.
- */
- TokenRefresh = 10,
-
- /**
- * Represents a password reset event.
- */
- PasswordReset = 20,
-
- /**
- * Represents a password change event.
- */
- PasswordChange = 21,
-
- /**
- * Represents enabling two-factor authentication in settings.
- */
- TwoFactorAuthEnable = 22,
-
- /**
- * Represents disabling two-factor authentication in settings.
- */
- TwoFactorAuthDisable = 23,
-
- /**
- * Represents a user registration event.
- */
- Register = 30,
-
- /**
- * Represents a user account deletion event.
- */
- AccountDeletion = 99,
-}
\ No newline at end of file
diff --git a/apps/mobile-app/utils/types/webapi/AuthLog.ts b/apps/mobile-app/utils/types/webapi/AuthLog.ts
deleted file mode 100644
index d12aa9249..000000000
--- a/apps/mobile-app/utils/types/webapi/AuthLog.ts
+++ /dev/null
@@ -1,44 +0,0 @@
-/**
- * Auth Log model.
- */
-export type AuthLogModel = {
- /**
- * Gets or sets the primary key for the auth log entry.
- */
- id: number;
-
- /**
- * Gets or sets the timestamp of the auth log entry.
- */
- timestamp: string;
-
- /**
- * Gets or sets the type of authentication event.
- */
- eventType: number;
-
- /**
- * Gets or sets the username associated with the auth log entry.
- */
- username: string;
-
- /**
- * Gets or sets the IP address from which the authentication attempt was made.
- */
- ipAddress: string;
-
- /**
- * Gets or sets the user agent string of the device used for the authentication attempt.
- */
- userAgent: string;
-
- /**
- * Gets or sets the client application name and version.
- */
- client: string;
-
- /**
- * Gets or sets a value indicating whether the authentication attempt was successful.
- */
- isSuccess: boolean;
-}
diff --git a/apps/mobile-app/utils/types/webapi/BadRequestResponse.ts b/apps/mobile-app/utils/types/webapi/BadRequestResponse.ts
deleted file mode 100644
index cc4598f7d..000000000
--- a/apps/mobile-app/utils/types/webapi/BadRequestResponse.ts
+++ /dev/null
@@ -1,9 +0,0 @@
-type BadRequestResponse = {
- type: string;
- title: string;
- status: number;
- errors: Record<string, string[]>;
- traceId: string;
-};
-
-export default BadRequestResponse;
diff --git a/apps/mobile-app/utils/types/webapi/DeleteAccountInitiate.ts b/apps/mobile-app/utils/types/webapi/DeleteAccountInitiate.ts
deleted file mode 100644
index 703d3fbbe..000000000
--- a/apps/mobile-app/utils/types/webapi/DeleteAccountInitiate.ts
+++ /dev/null
@@ -1,16 +0,0 @@
-/**
- * Represents a delete account initiate response.
- */
-export type DeleteAccountInitiateRequest = {
- username: string;
-};
-
-/**
- * Represents a delete account initiate response.
- */
-export type DeleteAccountInitiateResponse = {
- salt: string;
- serverEphemeral: string;
- encryptionType: string;
- encryptionSettings: string;
-};
diff --git a/apps/mobile-app/utils/types/webapi/DeleteAccountRequest.ts b/apps/mobile-app/utils/types/webapi/DeleteAccountRequest.ts
deleted file mode 100644
index 23cb3f26a..000000000
--- a/apps/mobile-app/utils/types/webapi/DeleteAccountRequest.ts
+++ /dev/null
@@ -1,8 +0,0 @@
-/**
- * Represents a delete account request.
- */
-export type DeleteAccountRequest = {
- username: string;
- clientPublicEphemeral: string;
- clientSessionProof: string;
-};
diff --git a/apps/mobile-app/utils/types/webapi/Email.ts b/apps/mobile-app/utils/types/webapi/Email.ts
deleted file mode 100644
index f88518999..000000000
--- a/apps/mobile-app/utils/types/webapi/Email.ts
+++ /dev/null
@@ -1,51 +0,0 @@
-import { Attachment } from "./Attachment";
-
-export type Email = {
- /** The body of the email message */
- messageHtml: string;
-
- /** The plain text body of the email message */
- messagePlain: string;
-
- /** The ID of the email */
- id: number;
-
- /** The subject of the email */
- subject: string;
-
- /** The display name of the sender */
- fromDisplay: string;
-
- /** The domain of the sender's email address */
- fromDomain: string;
-
- /** The local part of the sender's email address */
- fromLocal: string;
-
- /** The domain of the recipient's email address */
- toDomain: string;
-
- /** The local part of the recipient's email address */
- toLocal: string;
-
- /** The date of the email */
- date: string;
-
- /** The system date of the email */
- dateSystem: string;
-
- /** The number of seconds ago the email was received */
- secondsAgo: number;
-
- /**
- * The encrypted symmetric key which was used to encrypt the email message.
- * This key is encrypted with the public key of the user.
- */
- encryptedSymmetricKey: string;
-
- /** The public key of the user used to encrypt the symmetric key */
- encryptionKey: string;
-
- /** The attachments of the email */
- attachments: Attachment[];
-}
diff --git a/apps/mobile-app/utils/types/webapi/FaviconExtractModel.ts b/apps/mobile-app/utils/types/webapi/FaviconExtractModel.ts
deleted file mode 100644
index acb24911d..000000000
--- a/apps/mobile-app/utils/types/webapi/FaviconExtractModel.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-export type FaviconExtractModel = {
- image: string | null;
-}
diff --git a/apps/mobile-app/utils/types/webapi/Login.ts b/apps/mobile-app/utils/types/webapi/Login.ts
deleted file mode 100644
index 40a0822d8..000000000
--- a/apps/mobile-app/utils/types/webapi/Login.ts
+++ /dev/null
@@ -1,16 +0,0 @@
-/**
- * Login request type.
- */
-export type LoginRequest = {
- username: string;
-}
-
-/**
- * Login response type.
- */
-export type LoginResponse = {
- salt: string;
- serverEphemeral: string;
- encryptionType: string;
- encryptionSettings: string;
-}
diff --git a/apps/mobile-app/utils/types/webapi/MailboxBulk.ts b/apps/mobile-app/utils/types/webapi/MailboxBulk.ts
deleted file mode 100644
index 775b8c56d..000000000
--- a/apps/mobile-app/utils/types/webapi/MailboxBulk.ts
+++ /dev/null
@@ -1,21 +0,0 @@
-import { MailboxEmail } from "./MailboxEmail";
-
-/**
- * Mailbox bulk request type.
- */
-export type MailboxBulkRequest = {
- addresses: string[];
- page: number;
- pageSize: number;
-}
-
-/**
- * Mailbox bulk response type.
- */
-export type MailboxBulkResponse = {
- addresses: string[];
- currentPage: number;
- pageSize: number;
- totalRecords: number;
- mails: MailboxEmail[];
-}
\ No newline at end of file
diff --git a/apps/mobile-app/utils/types/webapi/MailboxEmail.ts b/apps/mobile-app/utils/types/webapi/MailboxEmail.ts
deleted file mode 100644
index dd15b9ae4..000000000
--- a/apps/mobile-app/utils/types/webapi/MailboxEmail.ts
+++ /dev/null
@@ -1,46 +0,0 @@
-export type MailboxEmail = {
- /** The preview of the email message */
- messagePreview: string;
-
- /** Indicates whether the email has attachments */
- hasAttachments: boolean;
-
- /** The ID of the email */
- id: number;
-
- /** The subject of the email */
- subject: string;
-
- /** The display name of the sender */
- fromDisplay: string;
-
- /** The domain of the sender's email address */
- fromDomain: string;
-
- /** The local part of the sender's email address */
- fromLocal: string;
-
- /** The domain of the recipient's email address */
- toDomain: string;
-
- /** The local part of the recipient's email address */
- toLocal: string;
-
- /** The date of the email */
- date: string;
-
- /** The system date of the email */
- dateSystem: string;
-
- /** The number of seconds ago the email was received */
- secondsAgo: number;
-
- /**
- * The encrypted symmetric key which was used to encrypt the email message.
- * This key is encrypted with the public key of the user.
- */
- encryptedSymmetricKey: string;
-
- /** The public key of the user used to encrypt the symmetric key */
- encryptionKey: string;
-}
\ No newline at end of file
diff --git a/apps/mobile-app/utils/types/webapi/PasswordChangeInitiateResponse.ts b/apps/mobile-app/utils/types/webapi/PasswordChangeInitiateResponse.ts
deleted file mode 100644
index a217476d0..000000000
--- a/apps/mobile-app/utils/types/webapi/PasswordChangeInitiateResponse.ts
+++ /dev/null
@@ -1,9 +0,0 @@
-/**
- * Represents a password change initiate response.
- */
-export type PasswordChangeInitiateResponse = {
- salt: string;
- serverEphemeral: string;
- encryptionType: string;
- encryptionSettings: string;
-};
diff --git a/apps/mobile-app/utils/types/webapi/RefreshToken.ts b/apps/mobile-app/utils/types/webapi/RefreshToken.ts
deleted file mode 100644
index 8d6b9cc2f..000000000
--- a/apps/mobile-app/utils/types/webapi/RefreshToken.ts
+++ /dev/null
@@ -1,21 +0,0 @@
-export type RefreshToken = {
- /**
- * Gets or sets the unique identifier for the refresh token.
- */
- id: string;
-
- /**
- * Gets or sets the device identifier associated with the refresh token.
- */
- deviceIdentifier: string;
-
- /**
- * Gets or sets the expiration date of the refresh token.
- */
- expireDate: string;
-
- /**
- * Gets or sets the creation date of the refresh token.
- */
- createdAt: string;
-}
diff --git a/apps/mobile-app/utils/types/webapi/StatusResponse.ts b/apps/mobile-app/utils/types/webapi/StatusResponse.ts
deleted file mode 100644
index 53d4181f0..000000000
--- a/apps/mobile-app/utils/types/webapi/StatusResponse.ts
+++ /dev/null
@@ -1,8 +0,0 @@
-/**
- * Status response type.
- */
-export type StatusResponse = {
- clientVersionSupported: boolean;
- serverVersion: string;
- vaultRevision: number;
-}
diff --git a/apps/mobile-app/utils/types/webapi/ValidateLogin.ts b/apps/mobile-app/utils/types/webapi/ValidateLogin.ts
deleted file mode 100644
index e64eaf216..000000000
--- a/apps/mobile-app/utils/types/webapi/ValidateLogin.ts
+++ /dev/null
@@ -1,32 +0,0 @@
-/**
- * Validate login request type.
- */
-export type ValidateLoginRequest = {
- username: string;
- rememberMe: boolean;
- clientPublicEphemeral: string;
- clientSessionProof: string;
-}
-
-/**
- * Validate login request type for 2FA.
- */
-export type ValidateLoginRequest2Fa = {
- username: string;
- code2Fa: number;
- rememberMe: boolean;
- clientPublicEphemeral: string;
- clientSessionProof: string;
-}
-
-/**
- * Validate login response type.
- */
-export type ValidateLoginResponse = {
- requiresTwoFactor: boolean;
- token?: {
- token: string;
- refreshToken: string;
- };
- serverSessionProof: string;
- }
\ No newline at end of file
diff --git a/apps/mobile-app/utils/types/webapi/Vault.ts b/apps/mobile-app/utils/types/webapi/Vault.ts
deleted file mode 100644
index e318aa196..000000000
--- a/apps/mobile-app/utils/types/webapi/Vault.ts
+++ /dev/null
@@ -1,17 +0,0 @@
-/**
- * Vault type.
- */
-export type Vault = {
- blob: string;
- createdAt: string;
- credentialsCount: number;
- currentRevisionNumber: number;
- emailAddressList: string[];
- privateEmailDomainList: string[];
- publicEmailDomainList: string[];
- encryptionPublicKey: string;
- updatedAt: string;
- username: string;
- version: string;
- client: string;
-}
\ No newline at end of file
diff --git a/apps/mobile-app/utils/types/webapi/VaultPasswordChangeRequest.ts b/apps/mobile-app/utils/types/webapi/VaultPasswordChangeRequest.ts
deleted file mode 100644
index 5651576cf..000000000
--- a/apps/mobile-app/utils/types/webapi/VaultPasswordChangeRequest.ts
+++ /dev/null
@@ -1,11 +0,0 @@
-import { Vault } from "./Vault";
-
-/**
- * Represents a request to change the users password including a new vault that is encrypted with the new password.
- */
-export type VaultPasswordChangeRequest = Vault & {
- currentClientPublicEphemeral: string;
- currentClientSessionProof: string;
- newPasswordSalt: string;
- newPasswordVerifier: string;
-}
diff --git a/apps/mobile-app/utils/types/webapi/VaultPostResponse.ts b/apps/mobile-app/utils/types/webapi/VaultPostResponse.ts
deleted file mode 100644
index 33de71718..000000000
--- a/apps/mobile-app/utils/types/webapi/VaultPostResponse.ts
+++ /dev/null
@@ -1,7 +0,0 @@
-/**
- * Vault post response type returned after uploading a new vault to the server.
- */
-export type VaultPostResponse = {
- status: number;
- newRevisionNumber: number;
-}
\ No newline at end of file
diff --git a/apps/mobile-app/utils/types/webapi/VaultResponse.ts b/apps/mobile-app/utils/types/webapi/VaultResponse.ts
deleted file mode 100644
index 06207affb..000000000
--- a/apps/mobile-app/utils/types/webapi/VaultResponse.ts
+++ /dev/null
@@ -1,9 +0,0 @@
-import { Vault } from "./Vault";
-
-/**
- * Vault response type.
- */
-export type VaultResponse = {
- status: number;
- vault: Vault;
-}
\ No newline at end of file
diff --git a/shared/models/build.sh b/shared/models/build.sh
index 2f69283e2..ee5ff68b3 100755
--- a/shared/models/build.sh
+++ b/shared/models/build.sh
@@ -6,6 +6,7 @@ set -u # Treat unset variables as errors
# Define output targets for models
TARGETS=(
"../../apps/browser-extension/src/utils/shared/models"
+ "../../apps/mobile-app/utils/shared/models"
)
# Build and distribute models