Monorepo for wisp.place. A static site hosting service built on top of the AT Protocol. wisp.place

fix objectObject

+10 -5
+1
bun.lock
··· 189 189 "version": "1.0.0", 190 190 "dependencies": { 191 191 "@atproto/api": "^0.18.17", 192 + "@wispplace/atproto-utils": "workspace:*", 192 193 "@wispplace/lexicons": "workspace:*", 193 194 }, 194 195 },
+1
packages/@wispplace/fs-utils/package.json
··· 33 33 }, 34 34 "dependencies": { 35 35 "@atproto/api": "^0.18.17", 36 + "@wispplace/atproto-utils": "workspace:*", 36 37 "@wispplace/lexicons": "workspace:*" 37 38 } 38 39 }
+8 -5
packages/@wispplace/fs-utils/src/tree.ts
··· 1 1 import type { BlobRef } from "@atproto/api"; 2 2 import type { Directory, Entry, File } from "@wispplace/lexicons/types/place/wisp/fs"; 3 + import { extractBlobCid } from "@wispplace/atproto-utils"; 3 4 4 5 export interface UploadedFile { 5 6 name: string; ··· 256 257 collectFileCidsFromEntries(node.entries, currentPath, fileCids); 257 258 } else if ('type' in node && node.type === 'file' && 'blob' in node) { 258 259 const fileNode = node as File; 259 - if (fileNode.blob && fileNode.blob.ref) { 260 - const ref = fileNode.blob.ref; 261 - // Handle both CID instances (CBOR/firehose) and IPLD link objects { $link } (JSON API) 262 - const cid = (typeof ref === 'object' && '$link' in ref) ? (ref as { $link: string }).$link : ref.toString(); 263 - fileCids[currentPath] = cid; 260 + if (fileNode.blob) { 261 + const cid = extractBlobCid(fileNode.blob); 262 + if (cid) { 263 + fileCids[currentPath] = cid; 264 + } else { 265 + console.warn(`[collectFileCids] Could not extract CID for file: ${currentPath}`); 266 + } 264 267 } 265 268 } 266 269 }