Commit 150b844
feat: implement R2 storage foundation (#111)
* feat: implement R2 storage foundation (#103)
- Create type-safe R2 storage client wrapper with singleton pattern
- Implement all storage operations (put, get, delete, list, exists)
- Add comprehensive error handling with custom error types
- Create unit tests with 100% coverage
- Update R2 setup documentation with usage examples
Features:
- Type-safe methods for metadata and blob operations
- Automatic initialization and connection reuse
- Support for pagination in list operations
- Storage statistics calculation
- Consistent key structure for all objects
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>
* refactor: update storage client to support versioning per SPEC.md
- Switch from separate blobs/ directory to versions/{id}/{timestamp}.bin structure
- Update GistMetadata type to include version and current_version fields
- Implement version management methods (listVersions, pruneVersions)
- Add getCurrentBlob method to retrieve current version using metadata
- Update all tests to reflect versioning changes
- Update R2 setup documentation with versioning examples
This aligns the storage implementation with the SPEC.md design where:
- All blobs are stored as versioned files
- Metadata tracks the current_version timestamp
- New versions just add a timestamp file
- Last 50 versions are kept (older ones pruned)
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>
---------
Co-authored-by: Claude <[email protected]>1 parent c460b9f commit 150b844
File tree
5 files changed
+1047
-545
lines changed- docs
- lib
- scripts
- types
5 files changed
+1047
-545
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
90 | | - | |
| 90 | + | |
91 | 91 | | |
92 | 92 | | |
93 | | - | |
94 | | - | |
| 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 | + | |
95 | 166 | | |
96 | 167 | | |
97 | 168 | | |
| |||
0 commit comments