- Resolved 'Ghost Account' warning by updating layout hydration to align with V3 ID Vision (account_id vs account_id_random). - Improved site lookup reliability using Agent API Key and structured EQ filters for exact FQDN matching (including ports). - Modernized PWA manifest with maskable icons (PNG/WebP), app shortcuts, and unique installation IDs. - Implemented automatic Electron 'Native' mode detection in root layout. - Fixed stale API URLs in Launcher native file download logic. - Added V3 migration documentation and JWT verification test scripts.
4.2 KiB
Project: CRUD V3 Final Migration
Status: Active / In Progress Last Updated: 2026-01-18 Goal: Eliminate all dependency on legacy API wrappers (
create_ae_obj_crud,get_ae_obj_id_crud, etc.) and ensure 100% adoption of the V3 Standard (/v3/crud/...).
1. Executive Summary
While the Journals and Identity (User/Account) modules have been successfully migrated to the V3 architecture, a significant portion of the Events, Sponsorships, and IDAA modules still rely on legacy V1/V2 wrappers. This document serves as the master checklist to reach 100% V3 compliance.
Why this matters:
- Security: V3 enforces strict multi-tenant isolation via JWT.
- Maintenance: Legacy wrappers in
api.tscontribute to technical debt and "God Object" anti-patterns. - Performance: V3 offers optimized search and partial updates (PATCH) that legacy endpoints lack.
2. Migration Audit (Findings)
The following files have been identified as using legacy CRUD wrappers.
🔴 High Priority: Events Module
The entire ae_events library is heavily dependent on legacy v2 list and v1 CRUD wrappers.
src/lib/ae_events/ae_events__event_session.tssrc/lib/ae_events/ae_events__event_presenter.tssrc/lib/ae_events/ae_events__event_presentation.tssrc/lib/ae_events/ae_events__event_location.tssrc/lib/ae_events/ae_events__event_badge_template.tssrc/lib/ae_events/ae_events__event_device.tssrc/lib/ae_events/ae_events__exhibit.tssrc/lib/ae_events/ae_events__event_file.ts
🟠 Medium Priority: Core & Sponsorships
Legacy patterns persisting in core logic and config modules.
src/lib/ae_sponsorships/ae_sponsorships_functions.tssrc/lib/ae_core/core__hosted_files.ts(Usesget_ae_obj_id_crud)src/lib/ae_core/core__site.ts(Usesget_ae_obj_id_crud)src/lib/ae_core/core__country_subdivisions.tssrc/lib/ae_core/core__time_zones.tssrc/lib/ae_core/core__countries.ts
🟡 Low Priority: UI Components & Routes
Specific UI components that make direct API calls instead of using store functions.
src/lib/elements/element_data_store.svelte(Directcreate_ae_obj_crud)src/lib/elements/element_data_store_v2.sveltesrc/routes/events/[event_id]/event_page_menu.sveltesrc/routes/events/[event_id]/(pres_mgmt)/session/ae_comp__event_session_alert.sveltesrc/routes/events/ae_comp__event_session_obj_li.sveltesrc/routes/idaa/(idaa)/recovery_meetings/ae_idaa_comp__event_obj_id_edit.svelte
3. Migration Procedure
For each file listed above, follow this standard refactoring pattern:
-
Imports:
- Remove imports of
create_ae_obj_crud,update_ae_obj_id_crud, etc. - Import V3 helpers:
get_ae_obj_v3,create_ae_obj_v3,update_ae_obj_v3,delete_ae_obj_v3,search_ae_obj_v3.
- Remove imports of
-
Pattern Replacement:
-
Get (Single):
- Old:
get_ae_obj_id_crud({ api_cfg, obj_type: 'event_session', obj_id: '...' }) - New:
get_ae_obj_v3({ api_cfg, obj_type: 'event_session', obj_id: '...' })
- Old:
-
Get (List):
- Old:
get_ae_obj_li_for_obj_id_crud_v2(...) - New:
get_ae_obj_li_v3(...)orsearch_ae_obj_v3(...)if complex filtering is needed.
- Old:
-
Update:
- Old:
update_ae_obj_id_crud({ ..., fields: { name: 'New Name' } }) - New:
update_ae_obj_v3({ ..., data: { name: 'New Name' } }) - Note: Ensure payload whitelisting is applied! V3 will 400 Error on unknown columns.
- Old:
-
Create:
- Old:
create_ae_obj_crud({ ..., fields: { ... } }) - New:
create_ae_obj_v3({ ..., data: { ... } })
- Old:
-
-
Verification:
- Verify the module still loads data (check Network tab for
/v3/requests). - Verify saving works (check for 400 Bad Request errors).
- Verify the module still loads data (check Network tab for
4. Final Cleanup
Once all checkboxes above are completed:
- Remove legacy exports from
src/lib/api/api.ts. - Delete
src/lib/ae_api/api_get__crud_obj_li_v1.ts. - Delete
src/lib/ae_api/api_get__crud_obj_li_v2.ts. - Delete
src/lib/ae_api/api_get__crud_obj_id.ts(Legacy version).