Commit b5fa5ab
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.
Changes:
- 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 documentation for Streamed List Objects API
- Update API endpoints table with 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
Dependencies:
- Requires x-fga-streaming: true in OpenAPI spec (openfga/api)
Related:
- Fixes #76 (JavaScript SDK)
- Implements openfga/js-sdk#236
- Related PR: openfga/js-sdk#2801 parent b411f38 commit b5fa5ab
1 file changed
+16
-15
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
16 | | - | |
| 15 | + | |
| 16 | + | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
26 | | - | |
| 25 | + | |
| 26 | + | |
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
37 | 36 | | |
38 | 37 | | |
39 | 38 | | |
| |||
61 | 60 | | |
62 | 61 | | |
63 | 62 | | |
64 | | - | |
65 | | - | |
| 63 | + | |
| 64 | + | |
66 | 65 | | |
67 | 66 | | |
68 | 67 | | |
| |||
80 | 79 | | |
81 | 80 | | |
82 | 81 | | |
83 | | - | |
| 82 | + | |
84 | 83 | | |
85 | 84 | | |
86 | | - | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
87 | 88 | | |
88 | 89 | | |
89 | 90 | | |
| |||
110 | 111 | | |
111 | 112 | | |
112 | 113 | | |
113 | | - | |
114 | | - | |
| 114 | + | |
| 115 | + | |
115 | 116 | | |
116 | 117 | | |
117 | 118 | | |
| |||
0 commit comments