ATlast — you'll never need to find your favorites on another platform again. Find your favs in the ATmosphere.
atproto
16
fork

Configure Feed

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

fix: replace any with proper types

byarielm.fyi 2aaf6d54 229f630e

verified
+11 -6
+6 -1
packages/api/src/middleware/error.ts
··· 67 67 68 68 // Handle generic ApiError (custom status codes) 69 69 if (err instanceof ApiError) { 70 + // Map known status codes, default to 500 for unknown 71 + const status = [400, 401, 403, 404, 500, 503].includes(err.statusCode) 72 + ? (err.statusCode as 400 | 401 | 403 | 404 | 500 | 503) 73 + : 500; 74 + 70 75 return c.json( 71 76 { 72 77 success: false, 73 78 error: err.message, 74 79 ...(err.details && { details: err.details }), 75 80 }, 76 - err.statusCode as any, 81 + status, 77 82 ); 78 83 } 79 84
+2 -2
packages/api/src/utils/encryption.utils.ts
··· 40 40 * @param data - Data to encrypt (will be JSON stringified) 41 41 * @returns Encrypted payload as JSON string 42 42 */ 43 - export function encryptToken(data: any): string { 43 + export function encryptToken<T = unknown>(data: T): string { 44 44 try { 45 45 const key = getEncryptionKey(); 46 46 const iv = randomBytes(16); ··· 77 77 * @param encrypted - Encrypted payload as JSON string 78 78 * @returns Decrypted data 79 79 */ 80 - export function decryptToken(encrypted: string): any { 80 + export function decryptToken<T = unknown>(encrypted: string): T { 81 81 try { 82 82 const key = getEncryptionKey(); 83 83 const payload: EncryptedPayload = JSON.parse(encrypted);
+1 -1
packages/api/src/utils/response.utils.ts
··· 3 3 * Provides consistent JSON response formatting 4 4 */ 5 5 6 - export interface ApiResponse<T = any> { 6 + export interface ApiResponse<T = unknown> { 7 7 success: boolean; 8 8 data?: T; 9 9 error?: string;
+2 -2
packages/api/src/utils/validation.utils.ts
··· 65 65 export function validateArrayInput<T>( 66 66 body: string | null, 67 67 fieldName: string, 68 - schema: z.ZodArray<any>, 68 + schema: z.ZodArray<z.ZodTypeAny>, 69 69 ): T[] { 70 70 const parsed = JSON.parse(body || "{}"); 71 71 const data = parsed[fieldName]; 72 72 73 - return validateInput(schema, data); 73 + return validateInput(schema, data) as T[]; 74 74 }