Commit 1d2c25e
committed
feat(js): add streaming support for streamedListObjects
Updates JavaScript SDK templates to support the streaming API endpoint
for unlimited object retrieval. Templates now handle streaming operations
differently using vendor extension conditionals.
Templates Modified (7 files):
- Add streaming.mustache template with NDJSON parser for Node.js
- Update api.mustache to import createStreamingRequestFunction
- Update apiInner.mustache with x-fga-streaming vendor extension logic
- Uses createStreamingRequestFunction for streaming ops
- Returns Promise<any> instead of PromiseResult<T>
- Simplified telemetry (method name only)
- Update index.mustache to export parseNDJSONStream
- Update config.overrides.json with streaming file + feature flag
- Add README_calling_api.mustache documentation for Streamed List Objects
- Add README_api_endpoints.mustache table entry for streaming endpoint
Implementation:
- Conditional template logic based on x-fga-streaming vendor extension
- Preserves telemetry while returning raw Node.js stream
- Aligned with Python SDK template patterns
- Fixed error propagation in async iterator adapter
- Widened parseNDJSONStream type signature for better DX
- Added guard to prevent onEnd processing after error state
Generated SDK Verification:
- ✅ streaming.ts generated with all error handling fixes
- ✅ parseNDJSONStream exported from index.ts
- ✅ StreamedListObjectsResponse interface in apiModel.ts
- 1 parent b5fa5ab commit 1d2c25e
1 file changed
+2
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
| |||
34 | 35 | | |
35 | 36 | | |
36 | 37 | | |
| 38 | + | |
37 | 39 | | |
38 | 40 | | |
39 | 41 | | |
| |||
49 | 51 | | |
50 | 52 | | |
51 | 53 | | |
52 | | - | |
53 | 54 | | |
54 | 55 | | |
55 | 56 | | |
| |||
0 commit comments