Skip to content

spotify-cli


spotify-cli / schemas/album

schemas/album

Zod schemas for Spotify album objects.

Type Aliases

Album

Album = z.infer<typeof AlbumSchema>

Defined in: src/schemas/album.ts:48

A full Spotify album with track listing and metadata.


SavedAlbum

SavedAlbum = z.infer<typeof SavedAlbumSchema>

Defined in: src/schemas/album.ts:51

A saved album from the user's library.


SimplifiedAlbum

SimplifiedAlbum = z.infer<typeof SimplifiedAlbumSchema>

Defined in: src/schemas/album.ts:45

A simplified Spotify album (no track listing).

Variables

AlbumSchema

const AlbumSchema: ZodObject<object & object, "strip", ZodTypeAny, { album_type: string; artists: object[]; copyrights?: object[]; external_ids?: { ean?: string; isrc?: string; upc?: string; }; external_urls: { spotify?: string; }; genres: string[]; href: string; id: string; images: object[]; label?: string; name: string; popularity?: number; release_date: string; release_date_precision: string; total_tracks: number; tracks: { href: string; items: object[]; limit: number; next: string | null; offset: number; previous: string | null; total: number; }; type: "album"; uri: string; }, { album_type: string; artists: object[]; copyrights?: object[]; external_ids?: { ean?: string; isrc?: string; upc?: string; }; external_urls: { spotify?: string; }; genres: string[]; href: string; id: string; images: object[]; label?: string; name: string; popularity?: number; release_date: string; release_date_precision: string; total_tracks: number; tracks: { href: string; items: object[]; limit: number; next: string | null; offset: number; previous: string | null; total: number; }; type: "album"; uri: string; }>

Defined in: src/schemas/album.ts:29

Schema for a full album object (includes track listing, genres, label).


SavedAlbumSchema

const SavedAlbumSchema: ZodObject<{ added_at: ZodString; album: ZodObject<object & object, "strip", ZodTypeAny, { album_type: string; artists: object[]; copyrights?: object[]; external_ids?: { ean?: string; isrc?: string; upc?: string; }; external_urls: { spotify?: string; }; genres: string[]; href: string; id: string; images: object[]; label?: string; name: string; popularity?: number; release_date: string; release_date_precision: string; total_tracks: number; tracks: { href: string; items: object[]; limit: number; next: string | null; offset: number; previous: string | null; total: number; }; type: "album"; uri: string; }, { album_type: string; artists: object[]; copyrights?: object[]; external_ids?: { ean?: string; isrc?: string; upc?: string; }; external_urls: { spotify?: string; }; genres: string[]; href: string; id: string; images: object[]; label?: string; name: string; popularity?: number; release_date: string; release_date_precision: string; total_tracks: number; tracks: { href: string; items: object[]; limit: number; next: string | null; offset: number; previous: string | null; total: number; }; type: "album"; uri: string; }>; }, "strip", ZodTypeAny, { added_at: string; album: { album_type: string; artists: object[]; copyrights?: object[]; external_ids?: { ean?: string; isrc?: string; upc?: string; }; external_urls: { spotify?: string; }; genres: string[]; href: string; id: string; images: object[]; label?: string; name: string; popularity?: number; release_date: string; release_date_precision: string; total_tracks: number; tracks: { href: string; items: object[]; limit: number; next: string | null; offset: number; previous: string | null; total: number; }; type: "album"; uri: string; }; }, { added_at: string; album: { album_type: string; artists: object[]; copyrights?: object[]; external_ids?: { ean?: string; isrc?: string; upc?: string; }; external_urls: { spotify?: string; }; genres: string[]; href: string; id: string; images: object[]; label?: string; name: string; popularity?: number; release_date: string; release_date_precision: string; total_tracks: number; tracks: { href: string; items: object[]; limit: number; next: string | null; offset: number; previous: string | null; total: number; }; type: "album"; uri: string; }; }>

Defined in: src/schemas/album.ts:39

Schema for a saved album (wraps an album with an added_at timestamp).


SimplifiedAlbumSchema

const SimplifiedAlbumSchema: ZodObject<{ album_type: ZodString; artists: ZodArray<ZodObject<{ external_urls: ZodObject<{ spotify: ZodOptional<ZodString>; }, "strip", ZodTypeAny, { spotify?: string; }, { spotify?: string; }>; href: ZodString; id: ZodString; name: ZodString; type: ZodLiteral<"artist">; uri: ZodString; }, "strip", ZodTypeAny, { external_urls: { spotify?: string; }; href: string; id: string; name: string; type: "artist"; uri: string; }, { external_urls: { spotify?: string; }; href: string; id: string; name: string; type: "artist"; uri: string; }>, "many">; 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">; 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; }>

Defined in: src/schemas/album.ts:13

Schema for a simplified album (used in track listings and search results).

MIT Licensed. Not affiliated with or endorsed by Spotify AB.