spotify-cli / schemas/playlist
schemas/playlist
Zod schemas for Spotify playlist objects.
Type Aliases
Playlist
Playlist =
z.infer<typeofPlaylistSchema>
Defined in: src/schemas/playlist.ts:69
A full Spotify playlist with track listing and followers.
PlaylistItem
PlaylistItem =
z.infer<typeofPlaylistItemSchema>
Defined in: src/schemas/playlist.ts:75
A single item in a playlist.
SimplifiedPlaylist
SimplifiedPlaylist =
z.infer<typeofSimplifiedPlaylistSchema>
Defined in: src/schemas/playlist.ts:72
A simplified playlist (no full track listing).
Variables
PlaylistItemSchema
constPlaylistItemSchema:ZodObject<{added_at:ZodNullable<ZodString>;added_by:ZodOptional<ZodNullable<ZodObject<{display_name:ZodOptional<ZodNullable<ZodString>>;external_urls:ZodObject<{spotify:ZodOptional<ZodString>; },"strip",ZodTypeAny, {spotify?:string; }, {spotify?:string; }>;href:ZodString;id:ZodString;type:ZodLiteral<"user">;uri:ZodString; },"strip",ZodTypeAny, {display_name?:string|null;external_urls: {spotify?:string; };href:string;id:string;type:"user";uri:string; }, {display_name?:string|null;external_urls: {spotify?:string; };href:string;id:string;type:"user";uri:string; }>>>;is_local:ZodBoolean;item:ZodOptional<ZodNullable<ZodObject<{album:ZodObject<{album_type:ZodString;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;uri:ZodString; },"strip",ZodTypeAny, {album_type:string;external_urls: {spotify?:string; };href:string;id:string;images:object[];name:string;release_date:string;uri:string; }, {album_type:string;external_urls: {spotify?:string; };href:string;id:string;images:object[];name:string;release_date:string;uri:string; }>;artists:ZodArray<ZodObject<{external_urls:ZodObject<{spotify: ...; },"strip",ZodTypeAny, {spotify?: ...; }, {spotify?: ...; }>;href:ZodString;id:ZodString;name:ZodString;type:ZodLiteral<"artist">;uri:ZodString; },"strip",ZodTypeAny, {external_urls: {spotify?: ... | ...; };href:string;id:string;name:string;type:"artist";uri:string; }, {external_urls: {spotify?: ... | ...; };href:string;id:string;name:string;type:"artist";uri:string; }>,"many">;disc_number:ZodNumber;duration_ms:ZodNumber;explicit:ZodBoolean;external_ids:ZodOptional<ZodObject<{ean:ZodOptional<ZodString>;isrc:ZodOptional<ZodString>;upc:ZodOptional<ZodString>; },"strip",ZodTypeAny, {ean?:string;isrc?:string;upc?:string; }, {ean?:string;isrc?:string;upc?:string; }>>;external_urls:ZodObject<{spotify:ZodOptional<ZodString>; },"strip",ZodTypeAny, {spotify?:string; }, {spotify?:string; }>;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?:string; };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?:string;isrc?:string;upc?:string; };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?:string; };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?:string;isrc?:string;upc?:string; };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; }>>>;primary_color:ZodOptional<ZodNullable<ZodString>>;video_thumbnail:ZodOptional<ZodNullable<ZodObject<{url:ZodNullable<ZodString>; },"strip",ZodTypeAny, {url:string|null; }, {url:string|null; }>>>; },"strip",ZodTypeAny, {added_at:string|null;added_by?: {display_name?:string|null;external_urls: {spotify?:string; };href:string;id:string;type:"user";uri:string; } |null;is_local:boolean;item?: {album: {album_type:string;external_urls: {spotify?:string; };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?:string;isrc?:string;upc?:string; };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; } |null;primary_color?:string|null;video_thumbnail?: {url:string|null; } |null; }, {added_at:string|null;added_by?: {display_name?:string|null;external_urls: {spotify?:string; };href:string;id:string;type:"user";uri:string; } |null;is_local:boolean;item?: {album: {album_type:string;external_urls: {spotify?:string; };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?:string;isrc?:string;upc?:string; };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; } |null;primary_color?:string|null;video_thumbnail?: {url:string|null; } |null; }>
Defined in: src/schemas/playlist.ts:22
Schema for a single item in a playlist (track with metadata about when/who added it).
PlaylistSchema
constPlaylistSchema:ZodObject<object&object,"strip",ZodTypeAny, {collaborative:boolean;description:string|null;external_urls: {spotify?:string; };followers: {href:string|null;total:number; };href:string;id:string;images:object[];items: {href:string;items:object[];limit:number;next:string|null;offset:number;previous:string|null;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; }, {collaborative:boolean;description:string|null;external_urls: {spotify?:string; };followers: {href:string|null;total:number; };href:string;id:string;images:object[];items: {href:string;items:object[];limit:number;next:string|null;offset:number;previous:string|null;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; }>
Defined in: src/schemas/playlist.ts:55
Schema for a full playlist object (includes followers and full track listing).
SimplifiedPlaylistSchema
constSimplifiedPlaylistSchema:ZodObject<{collaborative:ZodBoolean;description:ZodNullable<ZodString>;external_urls:ZodObject<{spotify:ZodOptional<ZodString>; },"strip",ZodTypeAny, {spotify?:string; }, {spotify?:string; }>;href:ZodString;id:ZodString;images:ZodArray<ZodObject<{height:ZodNullable<ZodNumber>;url:ZodString;width:ZodNullable<ZodNumber>; },"strip",ZodTypeAny, {height:number|null;url:string;width:number|null; }, {height:number|null;url:string;width:number|null; }>,"many">;items:ZodOptional<ZodObject<{href:ZodString;total:ZodNumber; },"strip",ZodTypeAny, {href:string;total:number; }, {href:string;total:number; }>>;name:ZodString;owner:ZodObject<{display_name:ZodOptional<ZodNullable<ZodString>>;external_urls:ZodObject<{spotify:ZodOptional<ZodString>; },"strip",ZodTypeAny, {spotify?:string; }, {spotify?:string; }>;href:ZodString;id:ZodString;type:ZodLiteral<"user">;uri:ZodString; },"strip",ZodTypeAny, {display_name?:string|null;external_urls: {spotify?:string; };href:string;id:string;type:"user";uri:string; }, {display_name?:string|null;external_urls: {spotify?:string; };href:string;id:string;type:"user";uri:string; }>;primary_color:ZodOptional<ZodNullable<ZodString>>;public:ZodNullable<ZodBoolean>;snapshot_id:ZodString;type:ZodLiteral<"playlist">;uri:ZodString; },"strip",ZodTypeAny, {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; }, {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; }>
Defined in: src/schemas/playlist.ts:32
Schema for a simplified playlist (used in listings and search results).