Commit d60757e
feat(storage): implement Object Contexts with advanced filtering and validation (#7548)
* feat(storage): add Object Contexts support to GCS metadata and listing
Updated internal request mapping in `file.ts` and `bucket.ts` to
include `contexts` in JSON payloads and `filter` in query strings.
Fixed baseline unit tests to accommodate the updated destination
metadata structure.
* feat(storage): implement Object Contexts with filtering and validation
- Add support for Object Contexts metadata in `File` and `Bucket`
operations.
- Update `FileMetadata`, `CopyOptions`, and `CombineOptions` types to
allow
null values for context key deletion (PATCH semantics).
- Refactor `validateContexts` to accept a `contexts` object directly for
better consistency and simpler call patterns in `save`, `copy`, and
`combine`.
- Implement server-side list filtering support via the `filter` query
parameter
in `getFiles`, supporting NOT logic and existence wildcards.
- Ensure metadata inheritance and explicit overrides work correctly
during
`File.copy` and `Bucket.combine`.
- Add comprehensive unit and system tests covering CRUD, server-side
operations, and complex filtering scenarios.
* docs(storage): document getFiles filtering and refactor validation logic
Extracted context validation into a shared helper for consistency and
updated getFiles JSDoc to include Object Context filter syntax and
examples.
---------
Co-authored-by: Gabe Pearhill <86282859+pearigee@users.noreply.github.com>
Co-authored-by: Dhriti07 <56169283+Dhriti07@users.noreply.github.com>1 parent ecac20f commit d60757e
6 files changed
Lines changed: 654 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
| 37 | + | |
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| 47 | + | |
47 | 48 | | |
48 | 49 | | |
49 | 50 | | |
| |||
178 | 179 | | |
179 | 180 | | |
180 | 181 | | |
| 182 | + | |
181 | 183 | | |
182 | 184 | | |
183 | 185 | | |
184 | 186 | | |
185 | 187 | | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
186 | 193 | | |
187 | 194 | | |
188 | 195 | | |
| |||
1654 | 1661 | | |
1655 | 1662 | | |
1656 | 1663 | | |
| 1664 | + | |
| 1665 | + | |
| 1666 | + | |
| 1667 | + | |
| 1668 | + | |
| 1669 | + | |
| 1670 | + | |
| 1671 | + | |
1657 | 1672 | | |
1658 | 1673 | | |
1659 | 1674 | | |
| |||
1708 | 1723 | | |
1709 | 1724 | | |
1710 | 1725 | | |
| 1726 | + | |
1711 | 1727 | | |
1712 | 1728 | | |
1713 | 1729 | | |
| |||
2673 | 2689 | | |
2674 | 2690 | | |
2675 | 2691 | | |
| 2692 | + | |
| 2693 | + | |
| 2694 | + | |
| 2695 | + | |
2676 | 2696 | | |
2677 | 2697 | | |
2678 | 2698 | | |
| |||
2720 | 2740 | | |
2721 | 2741 | | |
2722 | 2742 | | |
| 2743 | + | |
| 2744 | + | |
| 2745 | + | |
2723 | 2746 | | |
2724 | 2747 | | |
2725 | 2748 | | |
| |||
2739 | 2762 | | |
2740 | 2763 | | |
2741 | 2764 | | |
| 2765 | + | |
2742 | 2766 | | |
2743 | 2767 | | |
2744 | 2768 | | |
| |||
2832 | 2856 | | |
2833 | 2857 | | |
2834 | 2858 | | |
| 2859 | + | |
| 2860 | + | |
| 2861 | + | |
| 2862 | + | |
| 2863 | + | |
| 2864 | + | |
| 2865 | + | |
| 2866 | + | |
| 2867 | + | |
| 2868 | + | |
| 2869 | + | |
| 2870 | + | |
| 2871 | + | |
| 2872 | + | |
| 2873 | + | |
| 2874 | + | |
| 2875 | + | |
| 2876 | + | |
| 2877 | + | |
| 2878 | + | |
| 2879 | + | |
| 2880 | + | |
| 2881 | + | |
| 2882 | + | |
| 2883 | + | |
2835 | 2884 | | |
2836 | 2885 | | |
2837 | 2886 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
| 64 | + | |
64 | 65 | | |
65 | 66 | | |
66 | 67 | | |
| |||
382 | 383 | | |
383 | 384 | | |
384 | 385 | | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
385 | 391 | | |
386 | 392 | | |
387 | 393 | | |
| |||
485 | 491 | | |
486 | 492 | | |
487 | 493 | | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
488 | 500 | | |
489 | 501 | | |
490 | 502 | | |
| |||
499 | 511 | | |
500 | 512 | | |
501 | 513 | | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
502 | 519 | | |
503 | 520 | | |
504 | 521 | | |
| |||
1308 | 1325 | | |
1309 | 1326 | | |
1310 | 1327 | | |
| 1328 | + | |
| 1329 | + | |
| 1330 | + | |
| 1331 | + | |
| 1332 | + | |
| 1333 | + | |
| 1334 | + | |
| 1335 | + | |
1311 | 1336 | | |
1312 | 1337 | | |
1313 | 1338 | | |
| |||
4137 | 4162 | | |
4138 | 4163 | | |
4139 | 4164 | | |
4140 | | - | |
4141 | 4165 | | |
4142 | 4166 | | |
4143 | 4167 | | |
4144 | 4168 | | |
4145 | 4169 | | |
| 4170 | + | |
| 4171 | + | |
| 4172 | + | |
| 4173 | + | |
| 4174 | + | |
| 4175 | + | |
4146 | 4176 | | |
4147 | 4177 | | |
4148 | 4178 | | |
| |||
4246 | 4276 | | |
4247 | 4277 | | |
4248 | 4278 | | |
| 4279 | + | |
| 4280 | + | |
| 4281 | + | |
4249 | 4282 | | |
4250 | 4283 | | |
4251 | 4284 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
| |||
272 | 273 | | |
273 | 274 | | |
274 | 275 | | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
0 commit comments