fix(core): Resolve TypeScript strict mode and ES client API compatibility issues for v3.0.0

- Fix ES client v8+ API: use document/doc instead of body for index/update operations
- Add type assertions (as any) for ES client ILM, template, and search APIs
- Fix strict null checks with proper undefined handling (nullish coalescing)
- Fix MetricsCollector interface to match required method signatures
- Fix Logger.error signature compatibility in plugins
- Resolve TermsQuery type index signature conflict
- Remove sourceMap from tsconfig (handled by tsbuild with inlineSourceMap)
This commit is contained in:
2025-11-29 21:19:28 +00:00
parent ec8dfbcfe6
commit 820f84ee61
30 changed files with 344 additions and 220 deletions

View File

@@ -5,12 +5,14 @@
### Completed Components
**Phase 1: Foundation (100%)** - Complete
- Error handling with typed hierarchy
- Observability (logging, metrics, tracing)
- Configuration management with fluent builder
- Connection management with health checks and circuit breaker
**Phase 2: Domain APIs (100%)** - Complete! 🎉
- **Document API (100%)** - Complete fluent CRUD operations with sessions, iteration, snapshots
- **Query Builder (100%)** - Type-safe query construction with aggregations
- **Logging API (100%)** - Enterprise structured logging with:
@@ -43,6 +45,7 @@
- Example at `ts/examples/kv/kv-store-example.ts`
**Phase 3: Advanced Features (100%)** - Complete!
- **Plugin Architecture (100%)** - Extensible request/response middleware:
- Plugin lifecycle hooks (beforeRequest, afterResponse, onError)
- Plugin priority and execution ordering
@@ -99,22 +102,26 @@ const results = await createQuery<Product>('products')
const stats = await createQuery<Product>('products')
.matchAll()
.aggregations((agg) => {
agg.terms('brands', 'brand.keyword')
agg
.terms('brands', 'brand.keyword')
.subAggregation('avg_price', (sub) => sub.avg('avg_price', 'price'));
})
.execute();
```
### Next Priorities (Phase 4)
1. **Comprehensive Test Suite** - Full test coverage for all modules
2. **Migration Guide** - Guide from v2 to v3 API
3. **README Update** - Update main README with new v3 API documentation
### Structure
- Single `ts/` directory (no parallel structures)
- Single `tsconfig.json` with strict mode enabled
- All v3.0 code lives in `ts/` directory
### Known Issues
- Minor TypeScript strict mode import issues documented in `ts/QUICK_FIXES.md`
- Need to apply `import type` fixes for verbatimModuleSyntax compliance
- Need to apply `import type` fixes for verbatimModuleSyntax compliance