a collection of lightweight TypeScript packages for AT Protocol, the protocol powering Bluesky
atproto bluesky typescript npm
101
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat(lex-cli): emit blob size and accept constraints in codegen

Mary 22b51819 b36d1a80

+22 -1
+5
.changeset/strict-blob-codegen.md
··· 1 + --- 2 + '@atcute/lex-cli': minor 3 + --- 4 + 5 + emit blob size and accept constraints in codegen
+17 -1
packages/lexicons/lex-cli/src/codegen.ts
··· 890 890 891 891 // LexBlob 892 892 case 'blob': { 893 - return `${PURE} v.blob()`; 893 + let pipe: string[] = []; 894 + 895 + if (spec.maxSize !== undefined) { 896 + pipe.push(`${PURE} v.blobSize(${lit(spec.maxSize)})`); 897 + } 898 + 899 + if (spec.accept !== undefined && spec.accept.length > 0 && !spec.accept.includes('*/*')) { 900 + pipe.push(`${PURE} v.blobAccept(${lit(spec.accept)})`); 901 + } 902 + 903 + let call = `${PURE} v.blob()`; 904 + 905 + if (pipe.length !== 0) { 906 + call = `${PURE} v.constrain(${call}, [ ${pipe.join(', ')} ])`; 907 + } 908 + 909 + return call; 894 910 } 895 911 896 912 // LexIpldType