Add Subsonic API and types

This commit is contained in:
jeffvli 2023-04-24 01:21:29 -07:00
parent ea8c63b71b
commit bec328f1f4
5 changed files with 832 additions and 0 deletions

View file

@ -8,3 +8,16 @@ export const resultWithHeaders = <ItemType extends z.ZodTypeAny>(itemSchema: Ite
headers: z.instanceof(AxiosHeaders),
});
};
export const resultSubsonicBaseResponse = <ItemType extends z.ZodRawShape>(
itemSchema: ItemType,
) => {
return z.object({
'subsonic-response': z
.object({
status: z.string(),
version: z.string(),
})
.extend(itemSchema),
});
};