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