Commit Graph
1775 Commits
Author SHA1 Message Date
Matthew Raymer 7166dadbc0 fix(types): correct type imports and improve null safety
- Move type imports to their correct source locations:
  - GenericCredWrapper, GenericVerifiableCredential from interfaces/common
  - GiveSummaryRecord from interfaces/records
  - OfferVerifiableCredential from interfaces/claims
- Add null safety check for dbResult in retrieveAccountCount
- Initialize result variable to prevent undefined access

This change fixes TypeScript errors by ensuring types are imported from their
proper source files and improves code safety by adding proper null checks.
The type system can now correctly validate the usage of these types across
the codebase.
2025-05-28 08:56:54 +00:00
Matthew Raymer bc274bdf7f fix(types): improve account type safety and metadata handling
- Change retrieveAllAccountsMetadata to return Account[] instead of AccountEncrypted[]
  to better reflect its purpose of returning non-sensitive metadata
- Update ImportDerivedAccountView to use Account type and group by derivation path
- Update retrieveAllFullyDecryptedAccounts to use AccountEncrypted type for encrypted data
- Fix import path for Account type in ImportDerivedAccountView

This change improves type safety by making it explicit which functions handle
encrypted data vs metadata, and ensures consistent handling of account data
across the application. The metadata functions now correctly strip sensitive
fields while functions that need encrypted data maintain access to those fields.
2025-05-28 08:52:09 +00:00
Matthew Raymer 082f8c0126 feat(QRScanner): implement QRScannerOptions in WebInlineQRScanner
- Add proper handling of QRScannerOptions in startScan method
- Implement camera selection (front/back) via options.camera
- Add video preview toggle via options.showPreview
- Store options as class property for persistence
- Improve logging with options context
- Fix TypeScript error for unused options parameter

This change makes the QR scanner more configurable and properly
implements the QRScannerService interface contract.
2025-05-28 08:43:43 +00:00
Matthew Raymer fd09c7e426 fix(deepLinks): improve route validation and type safety
- Add early validation for route paths to prevent undefined access
- Introduce INVALID_ROUTE error type with detailed error information
- Simplify parameter mapping using nullish coalescing operator
- Improve type safety in parseDeepLink method
- Add better error details for invalid route paths

This change prevents potential runtime errors from undefined route access
and provides clearer error messages for invalid deep links.
2025-05-28 08:40:49 +00:00
Matthew Raymer be40643379 fix: unused element 2025-05-28 08:38:10 +00:00
Matthew Raymer 835a270e65 feat(qr-scanner): Add camera state management to CapacitorQRScanner
- Add camera state tracking and listener management
- Implement addCameraStateListener and removeCameraStateListener methods
- Add state transitions during scanning operations
- Improve error handling with state updates
- Add proper type imports for CameraState and CameraStateListener

This change ensures CapacitorQRScanner fully implements the QRScannerService
interface and provides proper camera state feedback to consumers. Camera state
is now tracked through the entire lifecycle of scanning operations, with
appropriate state transitions for initialization, active scanning, errors,
and cleanup.
2025-05-28 08:37:02 +00:00
Matthew Raymer 13682a1930 fix(db): add type declarations for SQL.js and absurd-sql modules
- Create type declarations in interfaces/absurd-sql.d.ts
- Import and use proper QueryExecResult and SqlValue types
- Add declarations for all required modules:
  - @jlongster/sql.js
  - absurd-sql
  - absurd-sql/dist/indexeddb-backend
  - absurd-sql/dist/indexeddb-main-thread
- Ensure type safety for database operations

This change resolves TypeScript errors about missing type declarations
while maintaining proper type safety for database operations. The
declarations are placed in the interfaces folder to match the project's
type organization.
2025-05-28 06:21:20 +00:00
Matthew Raymer 669a66c24c fix(db): improve type safety in AbsurdSqlDatabaseService
- Move external module type declarations to dedicated .d.ts file
- Make SQL.js types compatible with our database interface
- Fix type compatibility between operation queue and database results
- Add proper typing for database operations and results

This change improves type safety by:
1. Properly declaring types for external modules
2. Ensuring database operation results match our interface
3. Making the operation queue type-safe with generics
4. Removing duplicate type definitions

The remaining module resolution warnings can be safely ignored as they
don't affect runtime behavior and our type declarations are working.
2025-05-28 06:07:50 +00:00
Matthew Raymer 13505b539e fix(db): resolve type compatibility in AbsurdSqlDatabaseService
- Make QueuedOperation interface generic to properly handle operation types
- Fix type compatibility between queue operations and their resolvers
- Use explicit typing for operation queue to handle generic types
- Maintain type safety while allowing different operation return types

This fixes a TypeScript error where the operation queue's resolve function
was not properly typed to handle generic return types from database operations.
2025-05-28 06:02:55 +00:00
Matthew Raymer 07ac340733 feat(capacitor): implement storage permission checks for file operations
- Add permission checks before writeFile and writeAndShareFile operations
- Reuse existing checkStoragePermissions method for Android devices
- Maintain iOS-specific handling (early return for iOS permission model)
- Improve error handling and logging for permission-related issues

This change ensures proper storage permission handling on Android devices
while maintaining the existing iOS behavior. The permission checks run
before any file write operations, providing better error handling and
user experience.
2025-05-28 05:56:58 +00:00
Matthew Raymer ba2b2fc543 fix: placeholder for PyWebViewPlatformService writeAndShareFile 2025-05-28 05:06:31 +00:00
trentlarson 21184e7625 fix spelling of SQLite module for iOS 2025-05-27 21:11:07 -06:00
trentlarson 8d1511e38f convert all remaining DB writes & reads to SQL (with successful registration & claim) 2025-05-27 21:07:24 -06:00
Matthew Raymer b18112b869 WIP: disabling absurd-sql when using Capacitor SQLite 2025-05-27 13:15:41 +00:00
Matthew Raymer a228a9b1c0 fix: add requirements for capacitor/sqlite 2025-05-27 12:42:27 +00:00
Matthew Raymer 1560ff0829 feature: fleshed out capacitor and electron database operators 2025-05-27 11:23:52 +00:00
trentlarson 7de4125eb7 add SQL DB access to everywhere we are using the DB, up to the "C" files 2025-05-27 01:27:04 -06:00
Matthew Raymer 81d4f0c762 fix: resolve PWA build issues with SQL.js worker files
- Update worker format to ESM in Vite config to fix IIFE format error

- Increase PWA precache file size limit to 10MB to accommodate SQL.js files

- Fix type declarations for worker configuration

- Add proper type annotations for Vite config

- Add type declarations for absurd-sql module
2025-05-27 06:54:29 +00:00
trentlarson 4c1b4fe651 fix linting 2025-05-26 22:56:00 -06:00
Matthew Raymer e63541ef53 fix: update ESLint and VS Code settings
- Configure ESLint to ignore node_modules
- Add VS Code settings for Java diagnostics

This fixes the Android build issues and improves the development
environment by properly ignoring node_modules in linting and
diagnostics.
2025-05-27 04:43:52 +00:00
trentlarson 0bfc18c385 add encryption & decryption for the sensitive identity & mnemonic in SQL DB 2025-05-26 22:42:20 -06:00
Matthew Raymer 35f5df6b6b fix: move lexical declarations outside case blocks
fix: missing logger import
Move variable declarations outside switch statement in AbsurdSqlDatabaseService
to fix 'no-case-declarations' linter errors.
2025-05-27 03:21:55 +00:00
Matthew Raymer 0f1ac2b230 fix: move lexical declarations outside case blocks in AbsurdSqlDatabaseService
- Move queryResult and allResult declarations outside switch statement
- Change const declarations to let since they're now in outer scope
- Remove const declarations from inside case blocks

This fixes the 'no-case-declarations' linter errors by ensuring variables
are declared in a scope that encompasses all case blocks, preventing
potential scoping issues.

Note: Type definition errors for external modules remain and should be
addressed separately.
2025-05-27 03:14:02 +00:00
trentlarson 3c0bdeaed3 remove debugging console statements 2025-05-26 20:43:06 -06:00
trentlarson 11f2527b04 start adding the SQL approach to files, also using the Dexie approach if desired 2025-05-26 20:26:28 -06:00
trentlarson 5d8175aeeb add encryption for the two SQL columns, replace basic DB utils, add USE_DEXIE_DB flag, and start adding SQL everywhere 2025-05-26 19:03:20 -06:00
trentlarson b6b95cb0d0 remove unused redirect to start page (now that we're creating an ID up front) 2025-05-26 16:29:10 -06:00
trentlarson 655c5188a4 add queueing to the DB service so that requests get processed in order 2025-05-26 16:28:33 -06:00
trentlarson 8b7451330f remove possibility of failing a migration script and then succeeding on later ones 2025-05-26 15:50:37 -06:00
trentlarson b8fbc3f7a6 fix console error about "window" unavailable due to service worker 2025-05-26 15:49:44 -06:00
trentlarson 92dadba1cb rename the absurd-sql-specific items for clarity 2025-05-26 14:52:39 -06:00
trentlarson 3a6f585de0 adjust so DB calls go to the factory 2025-05-26 13:59:34 -06:00
trentlarson 2647c5a77d fix migrations logging error 2025-05-25 21:52:27 -06:00
Matt Raymer 682fceb1c6 Merge remote-tracking branch 'refs/remotes/origin/sql-absurd-sql' into sql-absurd-sql 2025-05-25 23:37:43 -04:00
Matt Raymer e0013008b4 refactor: improve type safety and browser compatibility - Replace any types with SqlValue[] in migration system - Add browser-compatible implementations of Node.js modules (crypto, fs, path) - Update Vite config to handle Node.js module polyfills - Remove outdated migration documentation files 2025-05-25 23:37:08 -04:00
trentlarson 0674d98670 fix BUILDING instructions 2025-05-25 21:29:57 -06:00
Matt Raymer ee441d1aea refactor(db): improve type safety in migration system
- Replace any[] with SqlValue[] type for SQL parameters in runMigrations
- Update import to use QueryExecResult from interfaces/database
- Add proper typing for SQL parameter values (string | number | null | Uint8Array)

This change improves type safety and helps catch potential SQL parameter
type mismatches at compile time, reducing the risk of runtime errors
or data corruption.
2025-05-25 23:09:53 -04:00
Matt Raymer 75f6e99200 chore: update migration documents and move to new home 2025-05-25 22:50:32 -04:00
Matt Raymer 52c9e57ef4 Merge remote-tracking branch 'refs/remotes/origin/sql-absurd-sql' into sql-absurd-sql 2025-05-25 22:47:36 -04:00
trentlarson 603823d808 add to build instructions for electron on mac 2025-05-25 20:48:51 -06:00
trentlarson 5f24f4975d fix linting 2025-05-25 20:48:33 -06:00
trentlarson 5057d7d07f don't always apply the camera-implementation cursor rules 2025-05-25 20:37:16 -06:00
trentlarson 946e88d903 add a input area for arbitrary SQL on the test page 2025-05-25 20:27:06 -06:00
Matt Raymer cbfb1ebf57 Merge branch 'new-storage' into sql-absurd-sql 2025-05-25 22:25:56 -04:00
trentlarson a38934e38d fix problems with race conditions and multiple DatabaseService instances 2025-05-25 19:46:15 -06:00
trentlarson a3bdcfd168 fix problem with initialization & refactor types 2025-05-25 18:32:41 -06:00
trentlarson 83771caee1 add more to the inital migration, and refactor the locations of types 2025-05-25 17:55:04 -06:00
trentlarson da35b225cd remove unused setting 2025-05-25 15:49:36 -06:00
trentlarson 8c3920e108 add DB setup with migrations 2025-05-25 11:06:30 -06:00
trentlarson 54f269054f fix error loading WASM file 2025-05-25 07:45:07 -06:00