refactor: migrate interfaces to dedicated directory

Reorganizes TypeScript interfaces into a modular structure:
- Create dedicated interfaces directory with specialized files
- Split interfaces by domain (claims, common, limits, records, user)
- Update imports in endorserServer.ts to use new interface locations
- Replace 'any' types with 'unknown' for better type safety
- Add proper type imports and exports

This improves code organization and maintainability by:
- Centralizing interface definitions
- Reducing file size of endorserServer.ts
- Making interface relationships more explicit
- Improving type safety with stricter types
This commit is contained in:
Matthew Raymer
2025-02-24 11:21:08 +00:00
parent 90d688dba1
commit 79ef59c5a9
69 changed files with 663 additions and 645 deletions

View File

@@ -3,17 +3,17 @@
* @description Initializes the application for Capacitor platform (iOS/Android)
* @author Matthew Raymer
* @version 0.4.4
*
*
* Process Flow:
* 1. Initialization
* - Logs start of initialization
* - Logs current platform
* - Initializes core application via main.common
*
*
* 2. Error Handling Setup
* - Registers global unhandled promise rejection handler
* - Routes API errors to error handling system
*
*
* 3. Deep Linking Configuration
* - Registers URL scheme handler (timesafari://)
* - Supports 11 parameterized routes:
@@ -28,17 +28,17 @@
* * offer-details
* * project
* * userProfile
*
*
* 4. Application Mounting
* - Mounts Vue application to DOM
* - Logs completion of mounting process
*
*
* Security Measures:
* - URL validation before processing
* - Type-safe error handling
* - Parameterized route pattern matching
* - Comprehensive error logging
*
*
* @example Deep Link Format
* timesafari://<route>/<parameter>
* timesafari://claim/01JMAAFZRNSRTQ0EBSD70A8E1H
@@ -66,16 +66,16 @@ window.addEventListener("unhandledrejection", (event) => {
* Handles deep link routing for the application
* Processes URLs in the format timesafari://<route>/<param>
* Maps incoming deep links to corresponding router paths with parameters
*
*
* @param {Object} data - Deep link data object
* @param {string} data.url - The full deep link URL to process
* @returns {Promise<void>}
*
*
* @example
* // Handles URLs like:
* // timesafari://claim/01JMAAFZRNSRTQ0EBSD70A8E1H
* // timesafari://project/abc123
*
*
* @throws {Error} If URL format is invalid
*/
const handleDeepLink = async (data: { url: string }) => {
@@ -95,17 +95,17 @@ const handleDeepLink = async (data: { url: string }) => {
// Define supported parameterized routes and their regex patterns
const paramRoutes = {
'claim-add-raw': /^claim-add-raw\/(.+)$/,
'claim-cert': /^claim-cert\/(.+)$/,
'claim': /^claim\/(.+)$/,
'confirm-gift': /^confirm-gift\/(.+)$/,
'contact-edit': /^contact-edit\/(.+)$/,
'contact-import': /^contact-import\/(.+)$/,
'did': /^did\/(.+)$/,
'invite-one-accept': /^invite-one-accept\/(.+)$/,
'offer-details': /^offer-details\/(.+)$/,
'project': /^project\/(.+)$/,
'userProfile': /^userProfile\/(.+)$/
"claim-add-raw": /^claim-add-raw\/(.+)$/,
"claim-cert": /^claim-cert\/(.+)$/,
claim: /^claim\/(.+)$/,
"confirm-gift": /^confirm-gift\/(.+)$/,
"contact-edit": /^contact-edit\/(.+)$/,
"contact-import": /^contact-import\/(.+)$/,
did: /^did\/(.+)$/,
"invite-one-accept": /^invite-one-accept\/(.+)$/,
"offer-details": /^offer-details\/(.+)$/,
project: /^project\/(.+)$/,
userProfile: /^userProfile\/(.+)$/,
};
// Match route pattern and extract parameter