learning_ai_common_plat/packages/sync/src/index.ts
saravanakumardb1 359d6e18a5 feat: Platform Acceleration + A/B Testing Framework
Platform Acceleration Phase 1:
- @bytelyst/sync package: Offline-first sync engine with conflict resolution
  - Storage adapters: LocalStorage, InMemory, MMKV
  - Deduplication, retry with backoff, auto-flush on reconnect
  - 12 comprehensive tests
- @bytelyst/dashboard-components package: Shared React components
  - ErrorPage, NotFoundPage, LoadingSpinner, LoadingSkeleton, EmptyState, PageHeader
  - Theme-aware with CSS custom properties

A/B Testing Framework (Complete):
- Admin UI at /ops/ab-testing with experiments list, variant performance, AI suggestions
- Sidebar navigation with Beaker icon
- 40 tests passing in ab-testing module

All 909 platform-service tests pass.
2026-03-03 19:47:47 -08:00

52 lines
1.2 KiB
TypeScript

/**
* @bytelyst/sync
*
* Offline-first sync engine with configurable storage adapters and conflict resolution.
*
* @example
* ```typescript
* import { createSyncEngine, LocalStorageAdapter } from '@bytelyst/sync';
* import { createApiClient } from '@bytelyst/api-client';
*
* const sync = createSyncEngine({
* productId: 'myapp',
* entities: {
* tasks: {
* endpoint: '/api/tasks',
* partitionKey: 'userId',
* conflictStrategy: 'server-wins',
* },
* },
* storage: new LocalStorageAdapter(),
* apiClient: createApiClient({ baseURL: 'https://api.example.com' }),
* });
*
* // Push changes
* await sync.push('tasks', { title: 'New Task' });
*
* // Sync with server
* const result = await sync.fullSync();
* console.log(`Pushed: ${result.pushed}, Pulled: ${result.pulled}`);
* ```
*/
export { createSyncEngine, SyncEngineImpl } from './engine.js';
export { LocalStorageAdapter, InMemoryAdapter, MMKVAdapter, type MMKVInstance } from './storage.js';
export type {
SyncEngine,
SyncEngineConfig,
EntityName,
EntityConfig,
ConflictStrategy,
SyncStatus,
SyncOperation,
SyncItem,
SyncResult,
SyncStatusInfo,
SyncStatusCallback,
StorageAdapter,
Conflict,
} from './types.js';