Why
Two distinct types named CloudinaryResource are exported from the same io/cloudinary/ module area — one the full SDK type and one the narrow validated subset — making the name ambiguous and giving callers no way to know which they are importing.
Current state
io/cloudinary/types.d.ts line 3 exports CloudinaryResource = ResourceApiResponse['resources'][0] (the full SDK type). io/cloudinary/fetchCloudinaryImageMetadata.ts line 72 exports CloudinaryResource = z.infer<typeof CloudinaryResourceSchema> (a narrow validated subset). Neither imports the other; both names coexist silently.
Ideal state
- There is exactly one
CloudinaryResource type: the Zod-inferred validated subset used at the boundary.
- The ambient
types.d.ts declaration is removed or renamed to an internal type that is not re-exported.
- A caller importing
CloudinaryResource from anywhere in io/cloudinary/ receives the same type.
Starting points
io/cloudinary/types.d.ts — line 3 (the duplicate to remove or rename)
io/cloudinary/fetchCloudinaryImageMetadata.ts — line 72 (the canonical definition to keep)
QA plan
- Search the codebase for
CloudinaryResource — expect exactly one export declaration.
- Run
tsc --noEmit — expect no type errors and no import ambiguity warnings.
- Open a file that imports
CloudinaryResource — verify it resolves to the Zod-inferred type, not the SDK type.
Done when
Exactly one CloudinaryResource type is exported from io/cloudinary/ and it is the validated subset inferred from CloudinaryResourceSchema.
Why
Two distinct types named
CloudinaryResourceare exported from the sameio/cloudinary/module area — one the full SDK type and one the narrow validated subset — making the name ambiguous and giving callers no way to know which they are importing.Current state
io/cloudinary/types.d.tsline 3 exportsCloudinaryResource = ResourceApiResponse['resources'][0](the full SDK type).io/cloudinary/fetchCloudinaryImageMetadata.tsline 72 exportsCloudinaryResource = z.infer<typeof CloudinaryResourceSchema>(a narrow validated subset). Neither imports the other; both names coexist silently.Ideal state
CloudinaryResourcetype: the Zod-inferred validated subset used at the boundary.types.d.tsdeclaration is removed or renamed to an internal type that is not re-exported.CloudinaryResourcefrom anywhere inio/cloudinary/receives the same type.Starting points
io/cloudinary/types.d.ts— line 3 (the duplicate to remove or rename)io/cloudinary/fetchCloudinaryImageMetadata.ts— line 72 (the canonical definition to keep)QA plan
CloudinaryResource— expect exactly one export declaration.tsc --noEmit— expect no type errors and no import ambiguity warnings.CloudinaryResource— verify it resolves to the Zod-inferred type, not the SDK type.Done when
Exactly one
CloudinaryResourcetype is exported fromio/cloudinary/and it is the validated subset inferred fromCloudinaryResourceSchema.