spotify-cli / schemas/search
schemas/search
Zod schema for Spotify search responses.
Type Aliases
SearchResponse
SearchResponse =
z.infer<typeofSearchResponseSchema>
Defined in: src/schemas/search.ts:28
Search results from the Spotify catalog.
Variables
SearchResponseSchema
constSearchResponseSchema:ZodObject<{albums:ZodOptional<ZodObject<{href:ZodString;items:ZodArray<ZodObject<{album_type:ZodString;artists:ZodArray<ZodObject<{external_urls: ...;href: ...;id: ...;name: ...;type: ...;uri: ...; },"strip",ZodTypeAny, {external_urls: ...;href: ...;id: ...;name: ...;type: ...;uri: ...; }, {external_urls: ...;href: ...;id: ...;name: ...;type: ...;uri: ...; }>,"many">;external_urls:ZodObject<{spotify:ZodOptional<...>; },"strip",ZodTypeAny, {spotify?: ... | ...; }, {spotify?: ... | ...; }>;href:ZodString;id:ZodString;images:ZodArray<ZodObject<{height: ...;url: ...;width: ...; },"strip",ZodTypeAny, {height: ...;url: ...;width: ...; }, {height: ...;url: ...;width: ...; }>,"many">;name:ZodString;release_date:ZodString;release_date_precision:ZodString;total_tracks:ZodNumber;type:ZodLiteral<"album">;uri:ZodString; },"strip",ZodTypeAny, {album_type:string;artists:object[];external_urls: {spotify?:string; };href:string;id:string;images:object[];name:string;release_date:string;release_date_precision:string;total_tracks:number;type:"album";uri:string; }, {album_type:string;artists:object[];external_urls: {spotify?:string; };href:string;id:string;images:object[];name:string;release_date:string;release_date_precision:string;total_tracks:number;type:"album";uri:string; }>,"many">;limit:ZodNumber;next:ZodNullable<ZodString>;offset:ZodNumber;previous:ZodNullable<ZodString>;total:ZodNumber; },"strip",ZodTypeAny, {href:string;items:object[];limit:number;next:string|null;offset:number;previous:string|null;total:number; }, {href:string;items:object[];limit:number;next:string|null;offset:number;previous:string|null;total:number; }>>;artists:ZodOptional<ZodObject<{href:ZodString;items:ZodArray<ZodObject<object&object,"strip",ZodTypeAny, {external_urls: {spotify?:string; };followers?: {href: ... | ...;total:number; };genres?:string[];href:string;id:string;images:object[];name:string;popularity?:number;type:"artist";uri:string; }, {external_urls: {spotify?:string; };followers?: {href: ... | ...;total:number; };genres?:string[];href:string;id:string;images:object[];name:string;popularity?:number;type:"artist";uri:string; }>,"many">;limit:ZodNumber;next:ZodNullable<ZodString>;offset:ZodNumber;previous:ZodNullable<ZodString>;total:ZodNumber; },"strip",ZodTypeAny, {href:string;items:object[];limit:number;next:string|null;offset:number;previous:string|null;total:number; }, {href:string;items:object[];limit:number;next:string|null;offset:number;previous:string|null;total:number; }>>;playlists:ZodOptional<ZodObject<{href:ZodString;items:ZodArray<ZodNullable<ZodObject<{collaborative:ZodBoolean;description:ZodNullable<ZodString>;external_urls:ZodObject<{spotify: ...; },"strip",ZodTypeAny, {spotify?: ...; }, {spotify?: ...; }>;href:ZodString;id:ZodString;images:ZodArray<ZodObject<..., ..., ..., ..., ...>,"many">;items:ZodOptional<ZodObject<..., ..., ..., ..., ...>>;name:ZodString;owner:ZodObject<{display_name: ...;external_urls: ...;href: ...;id: ...;type: ...;uri: ...; },"strip",ZodTypeAny, {display_name?: ...;external_urls: ...;href: ...;id: ...;type: ...;uri: ...; }, {display_name?: ...;external_urls: ...;href: ...;id: ...;type: ...;uri: ...; }>;primary_color:ZodOptional<ZodNullable<...>>;public:ZodNullable<ZodBoolean>;snapshot_id:ZodString;type:ZodLiteral<"playlist">;uri:ZodString; },"strip",ZodTypeAny, {collaborative:boolean;description:string|null;external_urls: {spotify?: ... | ...; };href:string;id:string;images:object[];items?: {href: ...;total: ...; };name:string;owner: {display_name?: ... | ... | ...;external_urls: {spotify?: ...; };href:string;id:string;type:"user";uri:string; };primary_color?:string|null;public:boolean|null;snapshot_id:string;type:"playlist";uri:string; }, {collaborative:boolean;description:string|null;external_urls: {spotify?: ... | ...; };href:string;id:string;images:object[];items?: {href: ...;total: ...; };name:string;owner: {display_name?: ... | ... | ...;external_urls: {spotify?: ...; };href:string;id:string;type:"user";uri:string; };primary_color?:string|null;public:boolean|null;snapshot_id:string;type:"playlist";uri:string; }>>,"many">;limit:ZodNumber;next:ZodNullable<ZodString>;offset:ZodNumber;previous:ZodNullable<ZodString>;total:ZodNumber; },"strip",ZodTypeAny, {href:string;items: ({collaborative:boolean;description:string|null;external_urls: {spotify?:string; };href:string;id:string;images:object[];items?: {href:string;total:number; };name:string;owner: {display_name?:string|null;external_urls: {spotify?: ... | ...; };href:string;id:string;type:"user";uri:string; };primary_color?:string|null;public:boolean|null;snapshot_id:string;type:"playlist";uri:string; } |null)[];limit:number;next:string|null;offset:number;previous:string|null;total:number; }, {href:string;items: ({collaborative:boolean;description:string|null;external_urls: {spotify?:string; };href:string;id:string;images:object[];items?: {href:string;total:number; };name:string;owner: {display_name?:string|null;external_urls: {spotify?: ... | ...; };href:string;id:string;type:"user";uri:string; };primary_color?:string|null;public:boolean|null;snapshot_id:string;type:"playlist";uri:string; } |null)[];limit:number;next:string|null;offset:number;previous:string|null;total:number; }>>;tracks:ZodOptional<ZodObject<{href:ZodString;items:ZodArray<ZodObject<{album:ZodObject<{album_type:ZodString;external_urls:ZodObject<..., ..., ..., ..., ...>;href:ZodString;id:ZodString;images:ZodArray<..., ...>;name:ZodString;release_date:ZodString;uri:ZodString; },"strip",ZodTypeAny, {album_type:string;external_urls: {spotify?: ...; };href:string;id:string;images: ...[];name:string;release_date:string;uri:string; }, {album_type:string;external_urls: {spotify?: ...; };href:string;id:string;images: ...[];name:string;release_date:string;uri:string; }>;artists:ZodArray<ZodObject<{external_urls: ...;href: ...;id: ...;name: ...;type: ...;uri: ...; },"strip",ZodTypeAny, {external_urls: ...;href: ...;id: ...;name: ...;type: ...;uri: ...; }, {external_urls: ...;href: ...;id: ...;name: ...;type: ...;uri: ...; }>,"many">;disc_number:ZodNumber;duration_ms:ZodNumber;explicit:ZodBoolean;external_ids:ZodOptional<ZodObject<{ean: ...;isrc: ...;upc: ...; },"strip",ZodTypeAny, {ean?: ...;isrc?: ...;upc?: ...; }, {ean?: ...;isrc?: ...;upc?: ...; }>>;external_urls:ZodObject<{spotify:ZodOptional<...>; },"strip",ZodTypeAny, {spotify?: ... | ...; }, {spotify?: ... | ...; }>;href:ZodString;id:ZodString;is_local:ZodBoolean;name:ZodString;popularity:ZodOptional<ZodNumber>;preview_url:ZodOptional<ZodNullable<ZodString>>;track_number:ZodNumber;type:ZodLiteral<"track">;uri:ZodString; },"strip",ZodTypeAny, {album: {album_type:string;external_urls: {spotify?: ... | ...; };href:string;id:string;images:object[];name:string;release_date:string;uri:string; };artists:object[];disc_number:number;duration_ms:number;explicit:boolean;external_ids?: {ean?: ... | ...;isrc?: ... | ...;upc?: ... | ...; };external_urls: {spotify?:string; };href:string;id:string;is_local:boolean;name:string;popularity?:number;preview_url?:string|null;track_number:number;type:"track";uri:string; }, {album: {album_type:string;external_urls: {spotify?: ... | ...; };href:string;id:string;images:object[];name:string;release_date:string;uri:string; };artists:object[];disc_number:number;duration_ms:number;explicit:boolean;external_ids?: {ean?: ... | ...;isrc?: ... | ...;upc?: ... | ...; };external_urls: {spotify?:string; };href:string;id:string;is_local:boolean;name:string;popularity?:number;preview_url?:string|null;track_number:number;type:"track";uri:string; }>,"many">;limit:ZodNumber;next:ZodNullable<ZodString>;offset:ZodNumber;previous:ZodNullable<ZodString>;total:ZodNumber; },"strip",ZodTypeAny, {href:string;items:object[];limit:number;next:string|null;offset:number;previous:string|null;total:number; }, {href:string;items:object[];limit:number;next:string|null;offset:number;previous:string|null;total:number; }>>; },"strip",ZodTypeAny, {albums?: {href:string;items:object[];limit:number;next:string|null;offset:number;previous:string|null;total:number; };artists?: {href:string;items:object[];limit:number;next:string|null;offset:number;previous:string|null;total:number; };playlists?: {href:string;items: ({collaborative:boolean;description:string|null;external_urls: {spotify?:string; };href:string;id:string;images:object[];items?: {href:string;total:number; };name:string;owner: {display_name?:string|null;external_urls: {spotify?:string; };href:string;id:string;type:"user";uri:string; };primary_color?:string|null;public:boolean|null;snapshot_id:string;type:"playlist";uri:string; } |null)[];limit:number;next:string|null;offset:number;previous:string|null;total:number; };tracks?: {href:string;items:object[];limit:number;next:string|null;offset:number;previous:string|null;total:number; }; }, {albums?: {href:string;items:object[];limit:number;next:string|null;offset:number;previous:string|null;total:number; };artists?: {href:string;items:object[];limit:number;next:string|null;offset:number;previous:string|null;total:number; };playlists?: {href:string;items: ({collaborative:boolean;description:string|null;external_urls: {spotify?:string; };href:string;id:string;images:object[];items?: {href:string;total:number; };name:string;owner: {display_name?:string|null;external_urls: {spotify?:string; };href:string;id:string;type:"user";uri:string; };primary_color?:string|null;public:boolean|null;snapshot_id:string;type:"playlist";uri:string; } |null)[];limit:number;next:string|null;offset:number;previous:string|null;total:number; };tracks?: {href:string;items:object[];limit:number;next:string|null;offset:number;previous:string|null;total:number; }; }>
Defined in: src/schemas/search.ts:20
Schema for the Spotify search endpoint response.
Each field is optional — only the types requested via the type query parameter will be present in the response.