@fluentcommerce/fc-connect-sdk 0.1.52 → 0.1.53

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,506 +1,514 @@
1
- # Changelog
2
-
3
- All notable changes to the Fluent Commerce Connect SDK will be documented in this file.
4
-
5
- The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
- and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
-
8
- ## [Unreleased]
9
-
10
- _No unreleased changes_
11
-
12
- ## [0.1.52] - 2026-02-15
13
-
14
- ### Added - Event API Log Query (REST GET Endpoints)
15
- - Added `getEvents(params)` to `FluentClient` and `FluentVersoriClient` for `GET /api/v4.1/event`
16
- - Search/query events with comprehensive filtering (entity type, status, date range, etc.)
17
- - Supports pagination with `start`/`count` parameters (max 5000 per page)
18
- - Full documentation with JSDoc examples for common use cases
19
- - Added `getEventById(eventId)` to `FluentClient` and `FluentVersoriClient` for `GET /api/v4.1/event/{eventId}`
20
- - Retrieve complete event details by unique identifier
21
- - Returns event metadata, context, attributes, and source event IDs
22
- - Useful for event tracing and debugging workflows
23
- - Added typed Event Log models: `FluentEventQueryParams`, `FluentEventLogResponse`, `FluentEventLogItem`, `FluentEventLogContext`, and `FluentEventLogAttribute`
24
- - Added typed Event constants for query safety: `FluentEventType`, `FluentEventStatus`, `FluentEventCategory`, `FluentEventRootEntityType`, and `FluentEventEntityType`
25
- - Added unit test coverage for query-string building, empty-filter handling, success parsing, and error paths
26
- - Updated API docs with `getEvents()` and `getEventById()` usage examples
27
-
28
- ### Added - Security & Compliance
29
- - **Security Audit Infrastructure** - Comprehensive security audit tools and scripts
30
- - `security-audit/security-audit.cjs` - Automated vulnerability scanning
31
- - `security-audit/safe-fix.cjs` - Safe vulnerability fixing with automatic testing
32
- - `security-audit/snyk-setup.cjs` - Snyk integration for advanced scanning
33
- - GitHub Actions workflow for automated security scans
34
- - Dependabot configuration for automated dependency updates
35
- - **Security Documentation** - Complete security and compliance guides
36
- - SOC 2 Compliance Guide
37
- - Vulnerability Checking Guide
38
- - Safe Fixing Guide
39
- - Advanced Scanning Guide (Snyk)
40
- - Security audit quick start
41
- - **Security Scripts** - NPM scripts for security management
42
- - `npm run security:check` - Comprehensive security audit
43
- - `npm run security:fix` - Safe vulnerability fixing
44
- - `npm run security:snyk` - Advanced Snyk scanning
45
- - `npm run security:full` - Full security check (npm audit + Snyk)
46
-
47
- ### Fixed - Security Vulnerabilities
48
- - **js-yaml vulnerabilities** (MODERATE) - Updated to secure versions (3.14.2, 4.1.1)
49
- - **@versori/run** - Updated from 0.4.4 to 0.4.11 (includes security fixes)
50
- - **markdownlint-cli** (HIGH) - Updated from 0.45.0 to 0.46.0 (fixes glob command injection)
51
- - **Removed unused dependency** - Removed unused `jose@5.10.0` package
52
- - **Security Status:** Reduced vulnerabilities from 12 to 3 (75% reduction)
53
- - Fixed: 2 Critical, 3 High, 4 Moderate, 1 Low
54
- - Remaining: 3 Moderate (transitive dependencies, no fix available)
55
-
56
- ## [0.1.51] - 2025-01-12
57
-
58
- ### Added
59
-
60
- **GraphQL Partial Response Support**
61
- - **New error handling mode**: Added `errorHandling: 'partial'` option for `FluentClient.graphql()` and `ExtractionOrchestrator`
62
- - Allows returning both `data` AND `errors` when GraphQL returns partial responses (GraphQL spec compliant)
63
- - Default behavior unchanged: `'throw'` mode throws `GraphQLExecutionError` on any errors (backward compatible)
64
- - Opt-in feature for scenarios where partial data is acceptable (batch operations, analytics, etc.)
65
- - **Response extensions**: Added `hasPartialData` flag to `GraphQLResponse` interface
66
- - Set to `true` when response contains both data and errors
67
- - Only present when `errorHandling: 'partial'` is used and errors occurred
68
- - **Error accumulation across pagination**: Partial mode accumulates errors from all pages
69
- - All GraphQL errors collected in `response.errors` array for paginated queries
70
- - ExtractionOrchestrator includes errors in `stats.partialErrors` field
71
- - **Null data handling**: ExtractionOrchestrator gracefully handles `data: null` with errors in partial mode
72
- - Returns empty array `[]` instead of throwing
73
- - Stops pagination when no data available (cannot determine if more pages exist)
74
- - Errors still accumulated in `stats.partialErrors`
75
- - Preserves backward compatibility: throw mode still throws original error messages
76
-
77
- **Use Cases:**
78
- - Batch mutations where some items may fail independently
79
- - Analytics/reporting where partial data is better than no data
80
- - Extraction workflows where some records may be inaccessible
81
- - Resilient data pipelines that continue despite errors
82
-
83
- **Usage Example:**
84
- ```typescript
85
- // Partial mode: get both successful and failed results
86
- const result = await client.graphql({
87
- query: batchMutation,
88
- errorHandling: 'partial' // Opt-in
89
- });
90
-
91
- if (result.hasPartialData) {
92
- // Process successful items
93
- processSuccessful(result.data);
94
-
95
- // Log or retry failed items
96
- for (const error of result.errors || []) {
97
- logger.warn('Failed item:', error.path, error.message);
98
- }
99
- }
100
-
101
- // Default mode (throw): fail fast on any error
102
- const criticalResult = await client.graphql({
103
- query: singleMutation
104
- // errorHandling: 'throw' is default
105
- });
106
- ```
107
-
108
- **Documentation:**
109
- - Complete guide: `docs/02-CORE-GUIDES/api-reference/modules/api-reference-12-partial-responses.md`
110
- - Best practices, migration guide, and edge case handling included
111
- - Integration examples with FluentClient, FluentVersoriClient, and ExtractionOrchestrator
112
-
113
- **Test Coverage:**
114
- - 9+ test scenarios in `tests/unit/fluent-client-partial-response.test.ts`
115
- - 5+ test scenarios in `tests/unit/services/extraction/extraction-orchestrator.test.ts` (including null data edge cases)
116
- - Edge cases: null data, empty errors array, error extensions, pagination, pagination stop on null data
117
-
118
- **Backward Compatibility:**
119
- - No breaking changes
120
- - Default behavior unchanged ('throw' mode)
121
- - Existing code continues to work without modifications
122
-
123
- ## [0.1.48] - 2025-11-19
124
-
125
- ### ⚠️ IMPORTANT - Share in Slack
126
-
127
- **Breaking Change in v0.1.47**: If you're using `httpStatus` from EventResponse, you must migrate to `statusCode`.
128
-
129
- ```typescript
130
- // ❌ OLD (no longer works)
131
- const status = response.httpStatus;
132
-
133
- // NEW (v0.1.47+)
134
- const status = response.statusCode;
135
- ```
136
-
137
- See v0.1.47 changelog below for full details.
138
-
139
- ### Added
140
- - **FluentVersoriClient connection validation enhancements** - Improved error handling and connection validation for Versori platform
141
- - **Event API template documentation** - 8 new templates for S3/SFTP ingestion with CSV, XML, JSON, Parquet formats
142
- - **Connection validation pattern guide** - New documentation for Versori connection validation patterns
143
- - **README error classification documentation** - Added comprehensive code examples for `classifyError` and `classifyErrors` functions
144
-
145
- ### Changed
146
- - **README updates** - Updated template count from 15+ to 23+, added Error Classification section to Core Services table
147
- - **Smart Error Handling documentation** - Added note about consistent `statusCode` field across success and error responses
148
- - **Error handling documentation improvements** - Added links to comprehensive error handling guide and quick reference
149
-
150
- ### Fixed
151
- - **FluentVersoriClient improvements** - 206 lines of enhancements for better error handling and connection management
152
-
153
- ## [0.1.47] - 2025-11-19
154
-
155
- ### Changed
156
- - **BREAKING: EventResponse interface standardized on `statusCode`**
157
- - Removed `httpStatus` field from EventResponse interface
158
- - HTTP status code is now consistently available as `statusCode` in both success and error responses
159
- - Success: `response.statusCode` (200, 201, 202)
160
- - Error: `error.statusCode` (400, 401, 404, 500, etc.)
161
- - Migration: Replace all `response.httpStatus` with `response.statusCode`
162
-
163
- ### Fixed
164
- - **Auth retry tests** - Updated expected error type from FluentAPIError to AuthenticationError after exhausting retries
165
- - **Test timeouts** - Added proper timeout for retry delay tests
166
-
167
- ## [0.1.46] - 2025-11-18
168
-
169
- ### Changed
170
- - Documentation consolidation for error handling
171
- - Removed duplicate module files in error-handling docs
172
- - Added SDK automatic retry behavior clarification
173
-
174
- ## [0.1.45] - 2025-11-17
175
-
176
- ### Added
177
- - **XML Helper Exports** (2025-11-17)
178
- - `getXmlAttribute` - Extract XML attributes from multiple parser formats (Versori $, SDK @, xml2js)
179
- - `getXmlTextContent` - Extract XML text content from multiple formats (_, #text, value)
180
- - `normalizeEmpty` - Normalize empty values (null, undefined, '', whitespace)
181
- - All three helpers now exported from `@fluentcommerce/fc-connect-sdk`
182
- - Comprehensive unit tests (19 tests) and inline JSDoc documentation
183
-
184
- ### Changed
185
- - **Resolver Helper Improvements** (2025-11-17)
186
- - SDK resolvers now use `helpers.getXmlTextContent` for XML text extraction
187
- - Replaces manual format checking (`attr._ || attr['#text'] || attr.value`)
188
- - Improves consistency across XML parser formats
189
-
190
- ### Notes
191
- - These helpers were previously internal-only and are now part of the public API
192
- - No breaking changes - existing code continues to work
193
- - Maintains backward compatibility with all existing resolver implementations
194
-
195
- ## [0.1.43] - 2025-01-14
196
-
197
- ### Added
198
-
199
- **GraphQL Error Classification Service** (2025-01-14)
200
- - **New error classification utilities**: Added `classifyError()` and `classifyErrors()` functions to classify Fluent Commerce GraphQL errors
201
- - **Retry guidance**: Automatically determines if errors are retryable based on error codes (C/S/T prefix)
202
- - **User-friendly messages**: Provides actionable error messages and recommended actions
203
- - **Error code support**: Handles Fluent Commerce error codes (C0121E, S0002E, etc.) with proper classification
204
- - **Export location**: Available via `import { classifyError, classifyErrors, type ErrorClassification } from '@fluentcommerce/fc-connect-sdk'`
205
-
206
- **Usage Example:**
207
- ```typescript
208
- import { classifyErrors } from '@fluentcommerce/fc-connect-sdk';
209
-
210
- if (response.errors) {
211
- const classification = classifyErrors(response.errors);
212
- if (classification.retryable) {
213
- // Retry with delay
214
- await delay(classification.retryDelaySeconds * 1000);
215
- } else {
216
- // Show error to user
217
- console.error(classification.userMessage);
218
- }
219
- }
220
- ```
221
-
222
- **Error Classification Features:**
223
- - Categorizes errors as CLIENT_ERROR, SERVER_ERROR, THIRD_PARTY_ERROR, or UNKNOWN
224
- - Provides retryability guidance (retryable: true/false)
225
- - Includes recommended action (FIX_AND_RETRY, RETRY_LATER, CONTACT_SUPPORT, VERIFY_PAYLOAD)
226
- - Suggests retry delay in seconds for retryable errors
227
- - Extracts error codes from multiple locations (extensions.code, message parsing)
228
-
229
- ## [0.1.41] - 2025-11-13
230
-
231
- ### Improved
232
-
233
- **GraphQLMutationMapper API Consistency** (2025-11-13)
234
- - **Auto-generates GraphQL query**: `mapWithNodes()` now includes `query` property in result (consistent with `map()` method)
235
- - **Explicit variables property**: Added `MapWithNodesResult.variables` for direct GraphQL execution
236
- - `variables` is auto-wrapped in `{ input: ... }` when using fields pattern
237
- - `data` remains unwrapped for direct field access (`result.data.orderRef`)
238
- - **Improved constructor options**: Added `MappingOptions` interface
239
- - `customResolvers` - Pass resolvers via constructor instead of every method call
240
- - `customTransforms` - Pass custom transforms via constructor
241
- - Method-level resolvers still supported (takes precedence over constructor resolvers)
242
- - **Optional resolvers parameter**: `mapWithNodes(sourceData)` - resolvers now optional
243
- - **Consistent error handling**: Returns structured error result (not throw) with `success: false`
244
-
245
- **Before (old pattern - removed):**
246
- ```typescript
247
- const mapper = new GraphQLMutationMapper(mappingConfig, client, logger);
248
- const result = await mapper.mapWithNodes(sourceData, customResolvers);
249
- const query = buildMutationQuery(mappingConfig); // Manual step
250
- await client.graphql({ query, variables: result.data });
251
- ```
252
-
253
- **After (new pattern - consistent with UniversalMapper):**
254
- ```typescript
255
- const mapper = new GraphQLMutationMapper(mappingConfig, logger, {
256
- customResolvers,
257
- fluentClient: client // Pass client via options
258
- });
259
- const result = await mapper.mapWithNodes(sourceData);
260
- await client.graphql({
261
- query: result.query, // Auto-generated
262
- variables: result.variables // Auto-wrapped if fields pattern
263
- });
264
- ```
265
-
266
- **Backward Compatibility:**
267
- - Existing code using `result.data` continues to work
268
- - Optional parameters maintain compatibility with existing code
269
-
270
- ### Fixed
271
-
272
- **GraphQLMutationMapper Bug Fixes** (2025-11-13)
273
- - **Empty `arguments: {}` detection**: Fixed `buildMutationQuery()` to treat empty `arguments: {}` as fields pattern
274
- - Previously, empty `arguments: {}` would not trigger `{ input: ... }` wrapping
275
- - Now correctly detects and wraps variables when using fields pattern
276
- - **Type safety**: Updated `MapWithNodesResult` interface with complete type definitions
277
- - **CRITICAL**: Fixed incorrect Versori credential access pattern in templates
278
- - Templates incorrectly used `connections.credentials().getAccessToken()` or `ctx.connections.credentials().getAccessToken()`
279
- - Correct pattern is `ctx.credentials().getAccessToken()`
280
- - This error caused runtime failures: `Cannot read properties of undefined (reading 'credentials')`
281
- - Fixed 7 template files across batch-api, graphql-mutations, and extraction workflows
282
- - Updated inline documentation comments to reflect correct pattern
283
- - Removed unnecessary `connections` destructuring from context objects
284
-
285
- ### Removed - OAuth2 Server Functionality
286
-
287
- **WebhookAuthService OAuth2 Server Methods Removed** (2025-11-06)
288
- - **BREAKING**: Removed OAuth2 server functionality from `WebhookAuthService`
289
- - Removed `issueToken()` method - OAuth2 token issuance no longer supported
290
- - Removed `validateToken()` method - OAuth2 token validation no longer supported
291
- - Removed `refreshToken()` method - OAuth2 token refresh no longer supported
292
- - Removed `revokeToken()` method - OAuth2 token revocation no longer supported
293
- - Removed `WebhookAuthServiceConfig` interface - constructor now only requires logger
294
- - Removed `jose` dependency - no longer needed for JWT token handling
295
- - **API Key Authentication**: `WebhookAuthService` now supports API key authentication only
296
- - `generateApiKey()` - Generate secure API keys
297
- - `generateApiKeyWithPrefix()` - Generate prefixed API keys
298
- - `hashApiKey()` - Hash API keys for secure storage
299
- - `validateApiKey()` - Validate API keys with lookup function
300
- - **Migration**: Users of OAuth2 server methods should migrate to API key authentication
301
- - **Note**: OAuth2 **client** authentication (FluentClient authenticating with Fluent Commerce) remains unchanged
302
-
303
- ## [0.1.39] - 2025-01-14
304
-
305
- ### Changed
306
- - **Production Ready Release**: Comprehensive documentation and feature completion
307
- - Fixed missing bin file (analyze-source-structure.js)
308
- - Fixed 449 documentation links (97% success rate)
309
- - Created 52 README files for improved navigation
310
- - Added 33 module files for complete feature coverage
311
- - All 7 CLI tools now functional
312
- - PDF documentation generated
313
- - Published to npm registry
314
-
315
- ### Documentation
316
- - Comprehensive documentation updates across all modules
317
- - Improved navigation with README files in all directories
318
- - Complete API reference documentation
319
- - Updated template examples and guides
320
- - CLI tool documentation
321
-
322
- ### Features (Stable)
323
- - TypeScript SDK for Fluent Commerce integration
324
- - Multi-runtime support (Node.js ≥18.0.0, Deno, Versori platform)
325
- - Complete API client with OAuth2 authentication
326
- - Data sources: S3, SFTP with connection pooling
327
- - Parsers: CSV, XML, JSON, Parquet
328
- - Mappers: UniversalMapper, GraphQLMutationMapper
329
- - Comprehensive test suite (97%+ coverage)
330
-
331
- ## [0.1.31] - 2025-01-14
332
-
333
- ### Code Changes
334
- - None
335
-
336
- ### Documentation
337
- - Fixed 32 critical documentation issues across 10 core guide sections
338
- - Corrected method names, type definitions, and configuration parameters
339
- - Updated 35+ documentation files with accurate examples
340
- - Improved overall documentation accuracy to 95%+
341
-
342
- ## Previous Releases
343
-
344
- ### Added - Security Enhancements
345
-
346
- **WebhookAuthService Security Features** (2025-01-XX)
347
- - **Token Revocation**: Added `revokeToken()` method with optional `revocationStore` configuration
348
- - Tokens can be revoked before expiry using JTI (JWT ID) blacklist
349
- - Automatic revocation check in `validateToken()` when revocation store is configured
350
- - Supports automatic cleanup via TTL (expiresAt)
351
- - **Rate Limiting**: Added sliding window rate limiting for `issueToken()` endpoint
352
- - Optional `rateLimitStore` configuration for persistent rate limiting
353
- - Configurable limits (default: 10 attempts per 60 seconds)
354
- - Per-username rate limiting to prevent brute force attacks
355
- - Fail-open behavior on rate limit errors (allows requests if check fails)
356
- - **Constant-Time Comparison**: Added `constantTimeEqualHex()` function for API key validation
357
- - Prevents timing attacks on API key validation
358
- - Automatic timing attack protection in `validateApiKey()` when `useConstantTimeComparison` is enabled
359
- - **Refresh Token Rotation**: Automatic refresh token rotation on each refresh
360
- - Old refresh tokens are automatically revoked when new tokens are issued
361
- - Requires `revocationStore` to be configured for rotation
362
- - **Token Type Consistency**: Added `type: 'access'` field to access tokens
363
- - Access tokens now include `type: 'access'` claim
364
- - Refresh tokens include `type: 'refresh'` claim
365
- - Improves token type validation and security
366
-
367
- ### Changed - Security Enhancements
368
-
369
- **WebhookAuthService API Changes** (2025-01-XX)
370
- - `validateApiKey()` now accepts optional `options` parameter:
371
- - `useConstantTimeComparison?: boolean` - Enable timing attack protection (default: true)
372
- - `compareHashed?: boolean` - If true, keyLookup expects hashed key
373
- - `WebhookAuthServiceConfig` now supports optional security features:
374
- - `revocationStore?: { get, set }` - Optional token revocation store
375
- - `rateLimitStore?: { get, set }` - Optional rate limiting store
376
- - `rateLimitConfig?: { maxAttempts, windowSeconds }` - Rate limiting configuration
377
-
378
- ### Testing
379
-
380
- **Security Test Coverage** (2025-01-XX)
381
- - Added comprehensive security test suite (500+ lines)
382
- - Token revocation tests (3 tests)
383
- - Rate limiting tests (4 tests)
384
- - Malformed token handling tests (5 tests)
385
- - Expired token handling tests (2 tests)
386
- - Token type validation tests (2 tests)
387
- - API key security tests (2 tests)
388
- - Refresh token rotation tests (2 tests)
389
- - Total test coverage: 20+ new security-specific tests
390
-
391
- ### Documentation
392
-
393
- **Security Documentation** (2025-01-XX)
394
- - Added `docs/04-REFERENCE/platforms/versori/webhook-auth-security-considerations.md` - Security best practices guide
395
- - Updated `README.md` with security features
396
- - Updated service documentation with security configuration examples
397
-
398
- ## [0.1.28] - 2025-10-30
399
-
400
- ### Documentation
401
-
402
- **README Critical Fixes** (2025-10-30)
403
- - Fixed missing FluentBatchManager (FBM) in Mermaid architecture diagram
404
- - Added FBM node to Service Layer subgraph (line 63)
405
- - Added FBM styling to match other services (line 138)
406
- - Restored 9 connections referencing FBM
407
- - **Impact:** Architecture diagram now renders correctly with all services visible
408
- - Fixed 2 broken links to mapper comparison guide
409
- - Updated paths from `docs/00-START-HERE/MAPPER-COMPARISON-GUIDE.md` to correct location
410
- - Correct path: `docs/02-CORE-GUIDES/mapping/mapper-comparison-guide.md`
411
- - **Impact:** Users can now access critical mapper selection guide
412
- - Fixed SDK philosophy filename case sensitivity issue
413
- - Changed from `SDK-PHILOSOPHY.md` (uppercase) to `sdk-philosophy.md` (lowercase)
414
- - **Impact:** Link now works on case-sensitive filesystems (Linux, macOS)
415
- - Verified all 24 documentation paths in README
416
- - All links validated and working
417
- - Cross-platform compatibility ensured
418
-
419
- **Previous README Improvements** (2025-10-30)
420
- - Added Table of Contents for improved navigation
421
- - Restructured to show Architecture/Services upfront before Quickstart
422
- - Fixed 2 hallucinated service names throughout README:
423
- - `BatchAPIClient` `FluentBatchManager` (correct SDK service name)
424
- - `IngestionOrchestrator` `IngestionService` (correct SDK service name)
425
- - Clarified logging approach: Function-based utilities (`createConsoleLogger`, `toStructuredLogger`) for standalone environments
426
- - Fixed 6 broken documentation links to match new 5-folder structure
427
- - Added complete S3 CSV → Batch API workflow example with real SDK methods
428
- - Added complete SFTP XML Batch API workflow example with real SDK methods
429
- - Added Universal Mapping section with XML/JSON transformation examples
430
- - Fixed architecture diagram with correct service names and relationships
431
- - Added "Learn More" sections linking to relevant documentation guides
432
- - Updated code examples to match actual SDK APIs (all examples now verified)
433
- - Improved "When to Use This SDK" decision table
434
- - Enhanced authentication section with OAuth2 token refresh details
435
- - Added Common Pitfalls section with quick fixes
436
-
437
- **Impact:** All README code examples now verified against SDK source. Documentation is now fully synchronized with actual SDK implementation. All critical documentation links fixed and verified.
438
-
439
- ## [0.1.27] - 2025-10-30
440
-
441
- ### Initial Release
442
-
443
- A TypeScript SDK for Fluent Commerce API integration with support for Node.js, Deno, and Versori platform.
444
-
445
- ### Features
446
-
447
- **Authentication & Security**
448
- - OAuth2 authentication with automatic token refresh
449
- - Refresh token support (`grant_type=refresh_token` when available)
450
- - Automatic 401 retry with exponential backoff (up to 3 attempts)
451
- - Thread-safe token refresh (prevents duplicate refresh requests)
452
- - Handles clock skew, server-side revocation, and multi-process conflicts
453
- - 60-second expiry buffer prevents mid-flight token expiry
454
- - Webhook signature validation with RSA cryptography
455
-
456
- **Data Ingestion**
457
- - Batch API with Batch Pre-Processing (BPP) for change detection
458
- - Event API for real-time updates
459
- - GraphQL mutations with automatic mapping
460
- - Support for CSV, XML, JSON, and Parquet formats
461
- - Universal field mapping with built-in resolvers
462
-
463
- **Data Extraction**
464
- - GraphQL queries with automatic cursor-based pagination
465
- - ExtractionOrchestrator for high-level extraction workflows
466
- - Path-based extraction for specific data nodes
467
- - Support for reverse pagination (most recent first)
468
-
469
- **Data Sources**
470
- - S3DataSource with streaming and retry logic
471
- - SftpDataSource with connection pooling and retry logic
472
- - Automatic archiving and error handling
473
-
474
- **Parsers**
475
- - CSVParserService with validation
476
- - XMLParserService with path resolution
477
- - JSONParserService with streaming
478
- - ParquetParserService for columnar data
479
-
480
- **Service Layer**
481
- - BatchAPIClient for batch operations
482
- - UniversalMapper for field transformations
483
- - StateService for distributed state management
484
- - JobTracker for job lifecycle tracking
485
- - PartialBatchRecovery for handling partial failures
486
- - PreflightValidator for pre-execution validation
487
-
488
- **Cross-Runtime Support**
489
- - Node.js ≥18.0.0
490
- - Deno runtime
491
- - Versori platform with native integration
492
- - Triple module system (CommonJS, ESM, TypeScript definitions)
493
-
494
- **Documentation**
495
- - 15+ production-ready templates (Versori + standalone)
496
- - Progressive learning guides (ingestion, extraction, mapping)
497
- - Reusable patterns (error handling, orchestrators)
498
- - Complete API reference
499
- - Architecture documentation
500
-
501
- ### Notes
502
-
503
- - **Zero Breaking Changes**: Maintains API stability
504
- - **Optional Features**: Refresh tokens depend on Fluent account configuration
505
- - **Versori Integration**: VersoriConnectionAdapter has native refresh token support
506
- - **Platform Detection**: Automatic environment detection (Node.js, Deno, Versori)
1
+ # Changelog
2
+
3
+ All notable changes to the Fluent Commerce Connect SDK will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [Unreleased]
9
+
10
+ _No unreleased changes_
11
+
12
+ ## [0.1.53] - 2026-02-15
13
+
14
+ ### Fixed - Event API GET Documentation and Typing Alignment
15
+ - Corrected README `getEvents()` documentation for `retailerId` behavior to clarify there is no automatic fallback to client config for query filters.
16
+ - Added explicit README guidance showing quoted dot-notation keys (for example, `'context.rootEntityType'`) when passing Event API GET context filters in JavaScript/TypeScript.
17
+ - Updated `FluentEventLogAttribute.value` type from `string` to `unknown` to match real Event API responses that can include non-string values (for example, numeric timers and nested objects).
18
+ - No runtime behavior changes to existing API methods; this patch aligns published docs/types with current SDK behavior.
19
+
20
+ ## [0.1.52] - 2026-02-15
21
+
22
+ ### Added - Event API Log Query (REST GET Endpoints)
23
+ - Added `getEvents(params)` to `FluentClient` and `FluentVersoriClient` for `GET /api/v4.1/event`
24
+ - Search/query events with comprehensive filtering (entity type, status, date range, etc.)
25
+ - Supports pagination with `start`/`count` parameters (max 5000 per page)
26
+ - Full documentation with JSDoc examples for common use cases
27
+ - Added `getEventById(eventId)` to `FluentClient` and `FluentVersoriClient` for `GET /api/v4.1/event/{eventId}`
28
+ - Retrieve complete event details by unique identifier
29
+ - Returns event metadata, context, attributes, and source event IDs
30
+ - Useful for event tracing and debugging workflows
31
+ - Added typed Event Log models: `FluentEventQueryParams`, `FluentEventLogResponse`, `FluentEventLogItem`, `FluentEventLogContext`, and `FluentEventLogAttribute`
32
+ - Added typed Event constants for query safety: `FluentEventType`, `FluentEventStatus`, `FluentEventCategory`, `FluentEventRootEntityType`, and `FluentEventEntityType`
33
+ - Added unit test coverage for query-string building, empty-filter handling, success parsing, and error paths
34
+ - Updated API docs with `getEvents()` and `getEventById()` usage examples
35
+
36
+ ### Added - Security & Compliance
37
+ - **Security Audit Infrastructure** - Comprehensive security audit tools and scripts
38
+ - `security-audit/security-audit.cjs` - Automated vulnerability scanning
39
+ - `security-audit/safe-fix.cjs` - Safe vulnerability fixing with automatic testing
40
+ - `security-audit/snyk-setup.cjs` - Snyk integration for advanced scanning
41
+ - GitHub Actions workflow for automated security scans
42
+ - Dependabot configuration for automated dependency updates
43
+ - **Security Documentation** - Complete security and compliance guides
44
+ - SOC 2 Compliance Guide
45
+ - Vulnerability Checking Guide
46
+ - Safe Fixing Guide
47
+ - Advanced Scanning Guide (Snyk)
48
+ - Security audit quick start
49
+ - **Security Scripts** - NPM scripts for security management
50
+ - `npm run security:check` - Comprehensive security audit
51
+ - `npm run security:fix` - Safe vulnerability fixing
52
+ - `npm run security:snyk` - Advanced Snyk scanning
53
+ - `npm run security:full` - Full security check (npm audit + Snyk)
54
+
55
+ ### Fixed - Security Vulnerabilities
56
+ - **js-yaml vulnerabilities** (MODERATE) - Updated to secure versions (3.14.2, 4.1.1)
57
+ - **@versori/run** - Updated from 0.4.4 to 0.4.11 (includes security fixes)
58
+ - **markdownlint-cli** (HIGH) - Updated from 0.45.0 to 0.46.0 (fixes glob command injection)
59
+ - **Removed unused dependency** - Removed unused `jose@5.10.0` package
60
+ - **Security Status:** Reduced vulnerabilities from 12 to 3 (75% reduction)
61
+ - Fixed: 2 Critical, 3 High, 4 Moderate, 1 Low
62
+ - Remaining: 3 Moderate (transitive dependencies, no fix available)
63
+
64
+ ## [0.1.51] - 2025-01-12
65
+
66
+ ### Added
67
+
68
+ **GraphQL Partial Response Support**
69
+ - **New error handling mode**: Added `errorHandling: 'partial'` option for `FluentClient.graphql()` and `ExtractionOrchestrator`
70
+ - Allows returning both `data` AND `errors` when GraphQL returns partial responses (GraphQL spec compliant)
71
+ - Default behavior unchanged: `'throw'` mode throws `GraphQLExecutionError` on any errors (backward compatible)
72
+ - Opt-in feature for scenarios where partial data is acceptable (batch operations, analytics, etc.)
73
+ - **Response extensions**: Added `hasPartialData` flag to `GraphQLResponse` interface
74
+ - Set to `true` when response contains both data and errors
75
+ - Only present when `errorHandling: 'partial'` is used and errors occurred
76
+ - **Error accumulation across pagination**: Partial mode accumulates errors from all pages
77
+ - All GraphQL errors collected in `response.errors` array for paginated queries
78
+ - ExtractionOrchestrator includes errors in `stats.partialErrors` field
79
+ - **Null data handling**: ExtractionOrchestrator gracefully handles `data: null` with errors in partial mode
80
+ - Returns empty array `[]` instead of throwing
81
+ - Stops pagination when no data available (cannot determine if more pages exist)
82
+ - Errors still accumulated in `stats.partialErrors`
83
+ - Preserves backward compatibility: throw mode still throws original error messages
84
+
85
+ **Use Cases:**
86
+ - Batch mutations where some items may fail independently
87
+ - Analytics/reporting where partial data is better than no data
88
+ - Extraction workflows where some records may be inaccessible
89
+ - Resilient data pipelines that continue despite errors
90
+
91
+ **Usage Example:**
92
+ ```typescript
93
+ // Partial mode: get both successful and failed results
94
+ const result = await client.graphql({
95
+ query: batchMutation,
96
+ errorHandling: 'partial' // Opt-in
97
+ });
98
+
99
+ if (result.hasPartialData) {
100
+ // Process successful items
101
+ processSuccessful(result.data);
102
+
103
+ // Log or retry failed items
104
+ for (const error of result.errors || []) {
105
+ logger.warn('Failed item:', error.path, error.message);
106
+ }
107
+ }
108
+
109
+ // Default mode (throw): fail fast on any error
110
+ const criticalResult = await client.graphql({
111
+ query: singleMutation
112
+ // errorHandling: 'throw' is default
113
+ });
114
+ ```
115
+
116
+ **Documentation:**
117
+ - Complete guide: `docs/02-CORE-GUIDES/api-reference/modules/api-reference-12-partial-responses.md`
118
+ - Best practices, migration guide, and edge case handling included
119
+ - Integration examples with FluentClient, FluentVersoriClient, and ExtractionOrchestrator
120
+
121
+ **Test Coverage:**
122
+ - 9+ test scenarios in `tests/unit/fluent-client-partial-response.test.ts`
123
+ - 5+ test scenarios in `tests/unit/services/extraction/extraction-orchestrator.test.ts` (including null data edge cases)
124
+ - Edge cases: null data, empty errors array, error extensions, pagination, pagination stop on null data
125
+
126
+ **Backward Compatibility:**
127
+ - No breaking changes
128
+ - Default behavior unchanged ('throw' mode)
129
+ - Existing code continues to work without modifications
130
+
131
+ ## [0.1.48] - 2025-11-19
132
+
133
+ ### ⚠️ IMPORTANT - Share in Slack
134
+
135
+ **Breaking Change in v0.1.47**: If you're using `httpStatus` from EventResponse, you must migrate to `statusCode`.
136
+
137
+ ```typescript
138
+ // ❌ OLD (no longer works)
139
+ const status = response.httpStatus;
140
+
141
+ // NEW (v0.1.47+)
142
+ const status = response.statusCode;
143
+ ```
144
+
145
+ See v0.1.47 changelog below for full details.
146
+
147
+ ### Added
148
+ - **FluentVersoriClient connection validation enhancements** - Improved error handling and connection validation for Versori platform
149
+ - **Event API template documentation** - 8 new templates for S3/SFTP ingestion with CSV, XML, JSON, Parquet formats
150
+ - **Connection validation pattern guide** - New documentation for Versori connection validation patterns
151
+ - **README error classification documentation** - Added comprehensive code examples for `classifyError` and `classifyErrors` functions
152
+
153
+ ### Changed
154
+ - **README updates** - Updated template count from 15+ to 23+, added Error Classification section to Core Services table
155
+ - **Smart Error Handling documentation** - Added note about consistent `statusCode` field across success and error responses
156
+ - **Error handling documentation improvements** - Added links to comprehensive error handling guide and quick reference
157
+
158
+ ### Fixed
159
+ - **FluentVersoriClient improvements** - 206 lines of enhancements for better error handling and connection management
160
+
161
+ ## [0.1.47] - 2025-11-19
162
+
163
+ ### Changed
164
+ - **BREAKING: EventResponse interface standardized on `statusCode`**
165
+ - Removed `httpStatus` field from EventResponse interface
166
+ - HTTP status code is now consistently available as `statusCode` in both success and error responses
167
+ - Success: `response.statusCode` (200, 201, 202)
168
+ - Error: `error.statusCode` (400, 401, 404, 500, etc.)
169
+ - Migration: Replace all `response.httpStatus` with `response.statusCode`
170
+
171
+ ### Fixed
172
+ - **Auth retry tests** - Updated expected error type from FluentAPIError to AuthenticationError after exhausting retries
173
+ - **Test timeouts** - Added proper timeout for retry delay tests
174
+
175
+ ## [0.1.46] - 2025-11-18
176
+
177
+ ### Changed
178
+ - Documentation consolidation for error handling
179
+ - Removed duplicate module files in error-handling docs
180
+ - Added SDK automatic retry behavior clarification
181
+
182
+ ## [0.1.45] - 2025-11-17
183
+
184
+ ### Added
185
+ - **XML Helper Exports** (2025-11-17)
186
+ - `getXmlAttribute` - Extract XML attributes from multiple parser formats (Versori $, SDK @, xml2js)
187
+ - `getXmlTextContent` - Extract XML text content from multiple formats (_, #text, value)
188
+ - `normalizeEmpty` - Normalize empty values (null, undefined, '', whitespace)
189
+ - All three helpers now exported from `@fluentcommerce/fc-connect-sdk`
190
+ - Comprehensive unit tests (19 tests) and inline JSDoc documentation
191
+
192
+ ### Changed
193
+ - **Resolver Helper Improvements** (2025-11-17)
194
+ - SDK resolvers now use `helpers.getXmlTextContent` for XML text extraction
195
+ - Replaces manual format checking (`attr._ || attr['#text'] || attr.value`)
196
+ - Improves consistency across XML parser formats
197
+
198
+ ### Notes
199
+ - These helpers were previously internal-only and are now part of the public API
200
+ - No breaking changes - existing code continues to work
201
+ - Maintains backward compatibility with all existing resolver implementations
202
+
203
+ ## [0.1.43] - 2025-01-14
204
+
205
+ ### Added
206
+
207
+ **GraphQL Error Classification Service** (2025-01-14)
208
+ - **New error classification utilities**: Added `classifyError()` and `classifyErrors()` functions to classify Fluent Commerce GraphQL errors
209
+ - **Retry guidance**: Automatically determines if errors are retryable based on error codes (C/S/T prefix)
210
+ - **User-friendly messages**: Provides actionable error messages and recommended actions
211
+ - **Error code support**: Handles Fluent Commerce error codes (C0121E, S0002E, etc.) with proper classification
212
+ - **Export location**: Available via `import { classifyError, classifyErrors, type ErrorClassification } from '@fluentcommerce/fc-connect-sdk'`
213
+
214
+ **Usage Example:**
215
+ ```typescript
216
+ import { classifyErrors } from '@fluentcommerce/fc-connect-sdk';
217
+
218
+ if (response.errors) {
219
+ const classification = classifyErrors(response.errors);
220
+ if (classification.retryable) {
221
+ // Retry with delay
222
+ await delay(classification.retryDelaySeconds * 1000);
223
+ } else {
224
+ // Show error to user
225
+ console.error(classification.userMessage);
226
+ }
227
+ }
228
+ ```
229
+
230
+ **Error Classification Features:**
231
+ - Categorizes errors as CLIENT_ERROR, SERVER_ERROR, THIRD_PARTY_ERROR, or UNKNOWN
232
+ - Provides retryability guidance (retryable: true/false)
233
+ - Includes recommended action (FIX_AND_RETRY, RETRY_LATER, CONTACT_SUPPORT, VERIFY_PAYLOAD)
234
+ - Suggests retry delay in seconds for retryable errors
235
+ - Extracts error codes from multiple locations (extensions.code, message parsing)
236
+
237
+ ## [0.1.41] - 2025-11-13
238
+
239
+ ### Improved
240
+
241
+ **GraphQLMutationMapper API Consistency** (2025-11-13)
242
+ - **Auto-generates GraphQL query**: `mapWithNodes()` now includes `query` property in result (consistent with `map()` method)
243
+ - **Explicit variables property**: Added `MapWithNodesResult.variables` for direct GraphQL execution
244
+ - `variables` is auto-wrapped in `{ input: ... }` when using fields pattern
245
+ - `data` remains unwrapped for direct field access (`result.data.orderRef`)
246
+ - **Improved constructor options**: Added `MappingOptions` interface
247
+ - `customResolvers` - Pass resolvers via constructor instead of every method call
248
+ - `customTransforms` - Pass custom transforms via constructor
249
+ - Method-level resolvers still supported (takes precedence over constructor resolvers)
250
+ - **Optional resolvers parameter**: `mapWithNodes(sourceData)` - resolvers now optional
251
+ - **Consistent error handling**: Returns structured error result (not throw) with `success: false`
252
+
253
+ **Before (old pattern - removed):**
254
+ ```typescript
255
+ const mapper = new GraphQLMutationMapper(mappingConfig, client, logger);
256
+ const result = await mapper.mapWithNodes(sourceData, customResolvers);
257
+ const query = buildMutationQuery(mappingConfig); // Manual step
258
+ await client.graphql({ query, variables: result.data });
259
+ ```
260
+
261
+ **After (new pattern - consistent with UniversalMapper):**
262
+ ```typescript
263
+ const mapper = new GraphQLMutationMapper(mappingConfig, logger, {
264
+ customResolvers,
265
+ fluentClient: client // Pass client via options
266
+ });
267
+ const result = await mapper.mapWithNodes(sourceData);
268
+ await client.graphql({
269
+ query: result.query, // Auto-generated
270
+ variables: result.variables // Auto-wrapped if fields pattern
271
+ });
272
+ ```
273
+
274
+ **Backward Compatibility:**
275
+ - Existing code using `result.data` continues to work
276
+ - Optional parameters maintain compatibility with existing code
277
+
278
+ ### Fixed
279
+
280
+ **GraphQLMutationMapper Bug Fixes** (2025-11-13)
281
+ - **Empty `arguments: {}` detection**: Fixed `buildMutationQuery()` to treat empty `arguments: {}` as fields pattern
282
+ - Previously, empty `arguments: {}` would not trigger `{ input: ... }` wrapping
283
+ - Now correctly detects and wraps variables when using fields pattern
284
+ - **Type safety**: Updated `MapWithNodesResult` interface with complete type definitions
285
+ - **CRITICAL**: Fixed incorrect Versori credential access pattern in templates
286
+ - Templates incorrectly used `connections.credentials().getAccessToken()` or `ctx.connections.credentials().getAccessToken()`
287
+ - Correct pattern is `ctx.credentials().getAccessToken()`
288
+ - This error caused runtime failures: `Cannot read properties of undefined (reading 'credentials')`
289
+ - Fixed 7 template files across batch-api, graphql-mutations, and extraction workflows
290
+ - Updated inline documentation comments to reflect correct pattern
291
+ - Removed unnecessary `connections` destructuring from context objects
292
+
293
+ ### Removed - OAuth2 Server Functionality
294
+
295
+ **WebhookAuthService OAuth2 Server Methods Removed** (2025-11-06)
296
+ - **BREAKING**: Removed OAuth2 server functionality from `WebhookAuthService`
297
+ - Removed `issueToken()` method - OAuth2 token issuance no longer supported
298
+ - Removed `validateToken()` method - OAuth2 token validation no longer supported
299
+ - Removed `refreshToken()` method - OAuth2 token refresh no longer supported
300
+ - Removed `revokeToken()` method - OAuth2 token revocation no longer supported
301
+ - Removed `WebhookAuthServiceConfig` interface - constructor now only requires logger
302
+ - Removed `jose` dependency - no longer needed for JWT token handling
303
+ - **API Key Authentication**: `WebhookAuthService` now supports API key authentication only
304
+ - `generateApiKey()` - Generate secure API keys
305
+ - `generateApiKeyWithPrefix()` - Generate prefixed API keys
306
+ - `hashApiKey()` - Hash API keys for secure storage
307
+ - `validateApiKey()` - Validate API keys with lookup function
308
+ - **Migration**: Users of OAuth2 server methods should migrate to API key authentication
309
+ - **Note**: OAuth2 **client** authentication (FluentClient authenticating with Fluent Commerce) remains unchanged
310
+
311
+ ## [0.1.39] - 2025-01-14
312
+
313
+ ### Changed
314
+ - **Production Ready Release**: Comprehensive documentation and feature completion
315
+ - Fixed missing bin file (analyze-source-structure.js)
316
+ - Fixed 449 documentation links (97% success rate)
317
+ - Created 52 README files for improved navigation
318
+ - Added 33 module files for complete feature coverage
319
+ - All 7 CLI tools now functional
320
+ - PDF documentation generated
321
+ - Published to npm registry
322
+
323
+ ### Documentation
324
+ - Comprehensive documentation updates across all modules
325
+ - Improved navigation with README files in all directories
326
+ - Complete API reference documentation
327
+ - Updated template examples and guides
328
+ - CLI tool documentation
329
+
330
+ ### Features (Stable)
331
+ - TypeScript SDK for Fluent Commerce integration
332
+ - Multi-runtime support (Node.js ≥18.0.0, Deno, Versori platform)
333
+ - Complete API client with OAuth2 authentication
334
+ - Data sources: S3, SFTP with connection pooling
335
+ - Parsers: CSV, XML, JSON, Parquet
336
+ - Mappers: UniversalMapper, GraphQLMutationMapper
337
+ - Comprehensive test suite (97%+ coverage)
338
+
339
+ ## [0.1.31] - 2025-01-14
340
+
341
+ ### Code Changes
342
+ - None
343
+
344
+ ### Documentation
345
+ - Fixed 32 critical documentation issues across 10 core guide sections
346
+ - Corrected method names, type definitions, and configuration parameters
347
+ - Updated 35+ documentation files with accurate examples
348
+ - Improved overall documentation accuracy to 95%+
349
+
350
+ ## Previous Releases
351
+
352
+ ### Added - Security Enhancements
353
+
354
+ **WebhookAuthService Security Features** (2025-01-XX)
355
+ - **Token Revocation**: Added `revokeToken()` method with optional `revocationStore` configuration
356
+ - Tokens can be revoked before expiry using JTI (JWT ID) blacklist
357
+ - Automatic revocation check in `validateToken()` when revocation store is configured
358
+ - Supports automatic cleanup via TTL (expiresAt)
359
+ - **Rate Limiting**: Added sliding window rate limiting for `issueToken()` endpoint
360
+ - Optional `rateLimitStore` configuration for persistent rate limiting
361
+ - Configurable limits (default: 10 attempts per 60 seconds)
362
+ - Per-username rate limiting to prevent brute force attacks
363
+ - Fail-open behavior on rate limit errors (allows requests if check fails)
364
+ - **Constant-Time Comparison**: Added `constantTimeEqualHex()` function for API key validation
365
+ - Prevents timing attacks on API key validation
366
+ - Automatic timing attack protection in `validateApiKey()` when `useConstantTimeComparison` is enabled
367
+ - **Refresh Token Rotation**: Automatic refresh token rotation on each refresh
368
+ - Old refresh tokens are automatically revoked when new tokens are issued
369
+ - Requires `revocationStore` to be configured for rotation
370
+ - **Token Type Consistency**: Added `type: 'access'` field to access tokens
371
+ - Access tokens now include `type: 'access'` claim
372
+ - Refresh tokens include `type: 'refresh'` claim
373
+ - Improves token type validation and security
374
+
375
+ ### Changed - Security Enhancements
376
+
377
+ **WebhookAuthService API Changes** (2025-01-XX)
378
+ - `validateApiKey()` now accepts optional `options` parameter:
379
+ - `useConstantTimeComparison?: boolean` - Enable timing attack protection (default: true)
380
+ - `compareHashed?: boolean` - If true, keyLookup expects hashed key
381
+ - `WebhookAuthServiceConfig` now supports optional security features:
382
+ - `revocationStore?: { get, set }` - Optional token revocation store
383
+ - `rateLimitStore?: { get, set }` - Optional rate limiting store
384
+ - `rateLimitConfig?: { maxAttempts, windowSeconds }` - Rate limiting configuration
385
+
386
+ ### Testing
387
+
388
+ **Security Test Coverage** (2025-01-XX)
389
+ - Added comprehensive security test suite (500+ lines)
390
+ - Token revocation tests (3 tests)
391
+ - Rate limiting tests (4 tests)
392
+ - Malformed token handling tests (5 tests)
393
+ - Expired token handling tests (2 tests)
394
+ - Token type validation tests (2 tests)
395
+ - API key security tests (2 tests)
396
+ - Refresh token rotation tests (2 tests)
397
+ - Total test coverage: 20+ new security-specific tests
398
+
399
+ ### Documentation
400
+
401
+ **Security Documentation** (2025-01-XX)
402
+ - Added `docs/04-REFERENCE/platforms/versori/webhook-auth-security-considerations.md` - Security best practices guide
403
+ - Updated `README.md` with security features
404
+ - Updated service documentation with security configuration examples
405
+
406
+ ## [0.1.28] - 2025-10-30
407
+
408
+ ### Documentation
409
+
410
+ **README Critical Fixes** (2025-10-30)
411
+ - Fixed missing FluentBatchManager (FBM) in Mermaid architecture diagram
412
+ - Added FBM node to Service Layer subgraph (line 63)
413
+ - Added FBM styling to match other services (line 138)
414
+ - Restored 9 connections referencing FBM
415
+ - **Impact:** Architecture diagram now renders correctly with all services visible
416
+ - Fixed 2 broken links to mapper comparison guide
417
+ - Updated paths from `docs/00-START-HERE/MAPPER-COMPARISON-GUIDE.md` to correct location
418
+ - Correct path: `docs/02-CORE-GUIDES/mapping/mapper-comparison-guide.md`
419
+ - **Impact:** Users can now access critical mapper selection guide
420
+ - Fixed SDK philosophy filename case sensitivity issue
421
+ - Changed from `SDK-PHILOSOPHY.md` (uppercase) to `sdk-philosophy.md` (lowercase)
422
+ - **Impact:** Link now works on case-sensitive filesystems (Linux, macOS)
423
+ - Verified all 24 documentation paths in README
424
+ - All links validated and working
425
+ - Cross-platform compatibility ensured
426
+
427
+ **Previous README Improvements** (2025-10-30)
428
+ - Added Table of Contents for improved navigation
429
+ - Restructured to show Architecture/Services upfront before Quickstart
430
+ - Fixed 2 hallucinated service names throughout README:
431
+ - `BatchAPIClient` `FluentBatchManager` (correct SDK service name)
432
+ - `IngestionOrchestrator` `IngestionService` (correct SDK service name)
433
+ - Clarified logging approach: Function-based utilities (`createConsoleLogger`, `toStructuredLogger`) for standalone environments
434
+ - Fixed 6 broken documentation links to match new 5-folder structure
435
+ - Added complete S3 CSV → Batch API workflow example with real SDK methods
436
+ - Added complete SFTP XML → Batch API workflow example with real SDK methods
437
+ - Added Universal Mapping section with XML/JSON transformation examples
438
+ - Fixed architecture diagram with correct service names and relationships
439
+ - Added "Learn More" sections linking to relevant documentation guides
440
+ - Updated code examples to match actual SDK APIs (all examples now verified)
441
+ - Improved "When to Use This SDK" decision table
442
+ - Enhanced authentication section with OAuth2 token refresh details
443
+ - Added Common Pitfalls section with quick fixes
444
+
445
+ **Impact:** All README code examples now verified against SDK source. Documentation is now fully synchronized with actual SDK implementation. All critical documentation links fixed and verified.
446
+
447
+ ## [0.1.27] - 2025-10-30
448
+
449
+ ### Initial Release
450
+
451
+ A TypeScript SDK for Fluent Commerce API integration with support for Node.js, Deno, and Versori platform.
452
+
453
+ ### Features
454
+
455
+ **Authentication & Security**
456
+ - OAuth2 authentication with automatic token refresh
457
+ - Refresh token support (`grant_type=refresh_token` when available)
458
+ - Automatic 401 retry with exponential backoff (up to 3 attempts)
459
+ - Thread-safe token refresh (prevents duplicate refresh requests)
460
+ - Handles clock skew, server-side revocation, and multi-process conflicts
461
+ - 60-second expiry buffer prevents mid-flight token expiry
462
+ - Webhook signature validation with RSA cryptography
463
+
464
+ **Data Ingestion**
465
+ - Batch API with Batch Pre-Processing (BPP) for change detection
466
+ - Event API for real-time updates
467
+ - GraphQL mutations with automatic mapping
468
+ - Support for CSV, XML, JSON, and Parquet formats
469
+ - Universal field mapping with built-in resolvers
470
+
471
+ **Data Extraction**
472
+ - GraphQL queries with automatic cursor-based pagination
473
+ - ExtractionOrchestrator for high-level extraction workflows
474
+ - Path-based extraction for specific data nodes
475
+ - Support for reverse pagination (most recent first)
476
+
477
+ **Data Sources**
478
+ - S3DataSource with streaming and retry logic
479
+ - SftpDataSource with connection pooling and retry logic
480
+ - Automatic archiving and error handling
481
+
482
+ **Parsers**
483
+ - CSVParserService with validation
484
+ - XMLParserService with path resolution
485
+ - JSONParserService with streaming
486
+ - ParquetParserService for columnar data
487
+
488
+ **Service Layer**
489
+ - BatchAPIClient for batch operations
490
+ - UniversalMapper for field transformations
491
+ - StateService for distributed state management
492
+ - JobTracker for job lifecycle tracking
493
+ - PartialBatchRecovery for handling partial failures
494
+ - PreflightValidator for pre-execution validation
495
+
496
+ **Cross-Runtime Support**
497
+ - Node.js ≥18.0.0
498
+ - Deno runtime
499
+ - Versori platform with native integration
500
+ - Triple module system (CommonJS, ESM, TypeScript definitions)
501
+
502
+ **Documentation**
503
+ - 15+ production-ready templates (Versori + standalone)
504
+ - Progressive learning guides (ingestion, extraction, mapping)
505
+ - Reusable patterns (error handling, orchestrators)
506
+ - Complete API reference
507
+ - Architecture documentation
508
+
509
+ ### Notes
510
+
511
+ - **Zero Breaking Changes**: Maintains API stability
512
+ - **Optional Features**: Refresh tokens depend on Fluent account configuration
513
+ - **Versori Integration**: VersoriConnectionAdapter has native refresh token support
514
+ - **Platform Detection**: Automatic environment detection (Node.js, Deno, Versori)