Commit 1ae73d0
authored
Support byte range downloads (#436)
* chore: update dependencies
- Update uuid to ^11.1.0 and add @types/uuid
- Update @autonomys/file-caching to ^1.5.1
- Update related dependencies across packages
* feat: add HTTP range request utility functions
- Add parseByteRange function for parsing Range headers
- Add createPartialStream function for creating range-aware streams
- Add utility functions for handling HTTP 206 partial content responses
- Support for byte-range requests in readable streams
* feat: implement range request support in download services
- Add ByteRange interface for range request parameters
- Implement partial download support in memory cache
- Add range-aware download methods in download service
- Support for caching partial content with byte ranges
- Add sync download functionality with range support
* feat: add HTTP range request support to download controllers
- Update download controller to handle Range headers
- Implement HTTP 206 Partial Content responses
- Add proper Content-Range and Accept-Ranges headers
- Support partial file downloads in object controllers
- Update use cases to handle byte range parameters
- Add range request support to object download endpoints
* test: add comprehensive tests for partial retrieval functionality
- Add tests for byte range parsing and validation
- Test partial content download scenarios
- Verify HTTP 206 response handling
- Add test cases for range request edge cases
- Test memory cache integration with range requests
* refactor: move to separate files related logic
* refactor: enhance download response handling with byte range support
- Introduced isExpectedDocument function to streamline document expectation checks
- Refactored handleDownloadResponseHeaders to utilize setFileResponseHeaders and setFolderResponseHeaders for improved clarity
- Added byte range handling in setFileResponseHeaders for partial content responses
- Updated content disposition and content type settings based on encryption and document expectations
* refactor: reorganize file use cases
* fix(testing): cache populated in async setting
* feat: update auto files gateway version
* update: bump auto-sdk version
* refactor: update FilesUseCases tests and imports
- Refactored tests for FilesUseCases to use getObjectInformation instead of getMetadata.
- Updated mock implementations to reflect changes in the download blocking logic.
- Cleaned up imports in files.spec.ts and index.ts for better organization and clarity.
* refactor: clean up imports in files.spec.ts
- Removed unused dbMigration import to streamline the test file and improve clarity.
* fix: update byte range header handling in getByteRange function
- Changed the header used to retrieve the byte range from 'content-range' to 'range' for improved accuracy in handling byte range requests.
* fix: enhance byte range validation in getByteRange function
- Added validation checks to ensure start and end byte values are non-negative and that the start value does not exceed the end value, improving the robustness of byte range handling.
* chore: update package dependencies to version 1.5.11
* chore: update yarn.lock to reflect package versions 1.5.11 for auto-dag-data and file-caching1 parent e3e34f0 commit 1ae73d0
File tree
25 files changed
+1710
-1153
lines changed- auth
- backend
- __tests__
- e2e/uploads
- unit/useCases
- src
- http/controllers
- services/download
- memoryDownloadCache
- useCases
- objects
- files
- uploads
- utils
- packages/models
- src
- downloads
- objects
25 files changed
+1710
-1153
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
| 35 | + | |
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
| 46 | + | |
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
33 | 32 | | |
34 | 33 | | |
35 | 34 | | |
| |||
38 | 37 | | |
39 | 38 | | |
40 | 39 | | |
41 | | - | |
42 | 40 | | |
43 | | - | |
44 | 41 | | |
45 | 42 | | |
46 | 43 | | |
47 | 44 | | |
| 45 | + | |
| 46 | + | |
48 | 47 | | |
49 | 48 | | |
50 | 49 | | |
51 | 50 | | |
52 | 51 | | |
53 | | - | |
| 52 | + | |
54 | 53 | | |
55 | 54 | | |
56 | 55 | | |
| |||
246 | 245 | | |
247 | 246 | | |
248 | 247 | | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
249 | 252 | | |
250 | | - | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
251 | 256 | | |
252 | 257 | | |
253 | 258 | | |
254 | 259 | | |
255 | 260 | | |
256 | 261 | | |
257 | 262 | | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
258 | 270 | | |
259 | 271 | | |
260 | 272 | | |
| |||
269 | 281 | | |
270 | 282 | | |
271 | 283 | | |
272 | | - | |
273 | | - | |
274 | | - | |
275 | | - | |
276 | | - | |
277 | | - | |
278 | | - | |
279 | | - | |
280 | | - | |
281 | | - | |
282 | | - | |
283 | | - | |
284 | | - | |
285 | | - | |
286 | | - | |
287 | | - | |
288 | | - | |
289 | | - | |
290 | | - | |
291 | | - | |
292 | 284 | | |
293 | 285 | | |
294 | 286 | | |
| |||
358 | 350 | | |
359 | 351 | | |
360 | 352 | | |
361 | | - | |
| 353 | + | |
362 | 354 | | |
363 | 355 | | |
364 | 356 | | |
| |||
368 | 360 | | |
369 | 361 | | |
370 | 362 | | |
371 | | - | |
372 | | - | |
373 | | - | |
374 | 363 | | |
375 | 364 | | |
376 | 365 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
| 17 | + | |
22 | 18 | | |
23 | 19 | | |
24 | 20 | | |
| |||
37 | 33 | | |
38 | 34 | | |
39 | 35 | | |
| 36 | + | |
40 | 37 | | |
41 | 38 | | |
42 | 39 | | |
| |||
365 | 362 | | |
366 | 363 | | |
367 | 364 | | |
368 | | - | |
| 365 | + | |
369 | 366 | | |
370 | 367 | | |
371 | 368 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
4 | 6 | | |
| 7 | + | |
5 | 8 | | |
6 | 9 | | |
7 | 10 | | |
| |||
27 | 30 | | |
28 | 31 | | |
29 | 32 | | |
30 | | - | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
31 | 49 | | |
32 | 50 | | |
33 | | - | |
| 51 | + | |
34 | 52 | | |
35 | 53 | | |
36 | 54 | | |
| |||
44 | 62 | | |
45 | 63 | | |
46 | 64 | | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
56 | 87 | | |
57 | 88 | | |
58 | 89 | | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
63 | 168 | | |
64 | 169 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
55 | | - | |
| 55 | + | |
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
| |||
0 commit comments