@saavn-labs/sdk 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +339 -0
- package/dist/core/models/album.d.ts +32 -0
- package/dist/core/models/album.js +1 -0
- package/dist/core/models/artist.d.ts +61 -0
- package/dist/core/models/artist.js +1 -0
- package/dist/core/models/index.d.ts +4 -0
- package/dist/core/models/index.js +4 -0
- package/dist/core/models/playlist.d.ts +35 -0
- package/dist/core/models/playlist.js +1 -0
- package/dist/core/models/song.d.ts +52 -0
- package/dist/core/models/song.js +1 -0
- package/dist/core/modules/album.module.d.ts +82 -0
- package/dist/core/modules/album.module.js +74 -0
- package/dist/core/modules/artist.module.d.ts +97 -0
- package/dist/core/modules/artist.module.js +49 -0
- package/dist/core/modules/extras.module.d.ts +385 -0
- package/dist/core/modules/extras.module.js +64 -0
- package/dist/core/modules/playlist.module.d.ts +79 -0
- package/dist/core/modules/playlist.module.js +74 -0
- package/dist/core/modules/song.module.d.ts +91 -0
- package/dist/core/modules/song.module.js +97 -0
- package/dist/helpers/errors.d.ts +25 -0
- package/dist/helpers/errors.js +84 -0
- package/dist/helpers/experimental/stream-urls/index.d.ts +20 -0
- package/dist/helpers/experimental/stream-urls/index.js +33 -0
- package/dist/helpers/experimental/stream-urls/stream-urls.edge.d.ts +4 -0
- package/dist/helpers/experimental/stream-urls/stream-urls.edge.js +38 -0
- package/dist/helpers/experimental/stream-urls/stream-urls.node.d.ts +4 -0
- package/dist/helpers/experimental/stream-urls/stream-urls.node.js +27 -0
- package/dist/helpers/fetch.d.ts +38 -0
- package/dist/helpers/fetch.js +38 -0
- package/dist/helpers/utils.d.ts +13 -0
- package/dist/helpers/utils.js +58 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.js +8 -0
- package/dist/saavn/common-mapper.d.ts +77 -0
- package/dist/saavn/common-mapper.js +348 -0
- package/dist/saavn/entities/album.entity.d.ts +151 -0
- package/dist/saavn/entities/album.entity.js +25 -0
- package/dist/saavn/entities/artist.entity.d.ts +274 -0
- package/dist/saavn/entities/artist.entity.js +49 -0
- package/dist/saavn/entities/base.d.ts +117 -0
- package/dist/saavn/entities/base.js +71 -0
- package/dist/saavn/entities/extras.d.ts +102 -0
- package/dist/saavn/entities/extras.js +43 -0
- package/dist/saavn/entities/index.d.ts +6 -0
- package/dist/saavn/entities/index.js +6 -0
- package/dist/saavn/entities/playlist.entity.d.ts +143 -0
- package/dist/saavn/entities/playlist.entity.js +55 -0
- package/dist/saavn/entities/show.entity.d.ts +14 -0
- package/dist/saavn/entities/show.entity.js +14 -0
- package/dist/saavn/entities/song.entity.d.ts +142 -0
- package/dist/saavn/entities/song.entity.js +48 -0
- package/dist/saavn/operations/get-details/index.d.ts +755 -0
- package/dist/saavn/operations/get-details/index.js +34 -0
- package/dist/saavn/operations/get-details/mapper.ops.d.ts +35 -0
- package/dist/saavn/operations/get-details/mapper.ops.js +55 -0
- package/dist/saavn/operations/get-details/schema.ops.d.ts +706 -0
- package/dist/saavn/operations/get-details/schema.ops.js +49 -0
- package/dist/saavn/operations/get-reco/index.d.ts +144 -0
- package/dist/saavn/operations/get-reco/index.js +19 -0
- package/dist/saavn/operations/get-reco/mapper.ops.d.ts +36 -0
- package/dist/saavn/operations/get-reco/mapper.ops.js +43 -0
- package/dist/saavn/operations/get-reco/schema.ops.d.ts +103 -0
- package/dist/saavn/operations/get-reco/schema.ops.js +28 -0
- package/dist/saavn/operations/get-trending/index.d.ts +288 -0
- package/dist/saavn/operations/get-trending/index.js +24 -0
- package/dist/saavn/operations/get-trending/mapper.ops.d.ts +13 -0
- package/dist/saavn/operations/get-trending/mapper.ops.js +134 -0
- package/dist/saavn/operations/get-trending/schema.ops.d.ts +272 -0
- package/dist/saavn/operations/get-trending/schema.ops.js +34 -0
- package/dist/saavn/operations/index.d.ts +6 -0
- package/dist/saavn/operations/index.js +6 -0
- package/dist/saavn/operations/search-results/index.d.ts +790 -0
- package/dist/saavn/operations/search-results/index.js +29 -0
- package/dist/saavn/operations/search-results/mapper.ops.d.ts +413 -0
- package/dist/saavn/operations/search-results/mapper.ops.js +80 -0
- package/dist/saavn/operations/search-results/schema.ops.d.ts +366 -0
- package/dist/saavn/operations/search-results/schema.ops.js +101 -0
- package/dist/saavn/operations/web-api/index.d.ts +604 -0
- package/dist/saavn/operations/web-api/index.js +29 -0
- package/dist/saavn/operations/web-api/mapper.ops.d.ts +11 -0
- package/dist/saavn/operations/web-api/mapper.ops.js +23 -0
- package/dist/saavn/operations/web-api/schema.ops.d.ts +582 -0
- package/dist/saavn/operations/web-api/schema.ops.js +50 -0
- package/dist/saavn/operations/web-radio/index.d.ts +181 -0
- package/dist/saavn/operations/web-radio/index.js +19 -0
- package/dist/saavn/operations/web-radio/mapper.ops.d.ts +14 -0
- package/dist/saavn/operations/web-radio/mapper.ops.js +35 -0
- package/dist/saavn/operations/web-radio/schema.ops.d.ts +162 -0
- package/dist/saavn/operations/web-radio/schema.ops.js +56 -0
- package/dist/saavn/primitives/enums.d.ts +17 -0
- package/dist/saavn/primitives/enums.js +4 -0
- package/dist/saavn/primitives/string.d.ts +5 -0
- package/dist/saavn/primitives/string.js +22 -0
- package/dist/saavn/run-operation.d.ts +12 -0
- package/dist/saavn/run-operation.js +39 -0
- package/dist/schemas/index.d.ts +2188 -0
- package/dist/schemas/index.js +14 -0
- package/dist/types.d.ts +24 -0
- package/dist/types.js +1 -0
- package/package.json +82 -0
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { SaavnAlbumEntity, SaavnArtistEntity, SaavnPlaylistEntity, SaavnSongEntity, SaavnTopSearchesEntity, } from '../../entities';
|
|
3
|
+
import { CSVString, NonEmptyString, PositiveString, } from '../../primitives/string';
|
|
4
|
+
import { SaavnSortBySchema, SaavnSortOrderSchema, } from '../../primitives/enums';
|
|
5
|
+
export const SaavnGetDetailsSchema = {
|
|
6
|
+
album: {
|
|
7
|
+
params: z.strictObject({
|
|
8
|
+
albumid: PositiveString,
|
|
9
|
+
}),
|
|
10
|
+
response: SaavnAlbumEntity,
|
|
11
|
+
},
|
|
12
|
+
artist: {
|
|
13
|
+
params: z.strictObject({
|
|
14
|
+
artistId: PositiveString,
|
|
15
|
+
n_song: PositiveString.optional(),
|
|
16
|
+
n_album: PositiveString.optional(),
|
|
17
|
+
category: SaavnSortBySchema.optional(),
|
|
18
|
+
sort_order: SaavnSortOrderSchema.optional(),
|
|
19
|
+
}),
|
|
20
|
+
response: SaavnArtistEntity,
|
|
21
|
+
},
|
|
22
|
+
playlist: {
|
|
23
|
+
params: z.strictObject({
|
|
24
|
+
listid: PositiveString,
|
|
25
|
+
p: PositiveString.optional(),
|
|
26
|
+
n: PositiveString.optional(),
|
|
27
|
+
}),
|
|
28
|
+
response: SaavnPlaylistEntity,
|
|
29
|
+
},
|
|
30
|
+
songs: {
|
|
31
|
+
params: z.strictObject({
|
|
32
|
+
pids: CSVString,
|
|
33
|
+
}),
|
|
34
|
+
response: z.looseObject({
|
|
35
|
+
songs: z.array(SaavnSongEntity),
|
|
36
|
+
}),
|
|
37
|
+
},
|
|
38
|
+
topAlbumsOfTheYear: {
|
|
39
|
+
params: z.strictObject({
|
|
40
|
+
album_year: PositiveString,
|
|
41
|
+
album_lang: NonEmptyString.optional(),
|
|
42
|
+
}),
|
|
43
|
+
response: z.array(SaavnAlbumEntity),
|
|
44
|
+
},
|
|
45
|
+
topSearches: {
|
|
46
|
+
params: z.strictObject({}),
|
|
47
|
+
response: z.array(SaavnTopSearchesEntity),
|
|
48
|
+
},
|
|
49
|
+
};
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import { SaavnGetRecoSchema } from './schema.ops';
|
|
2
|
+
export declare const SaavnGetReco: {
|
|
3
|
+
albums: {
|
|
4
|
+
call: string;
|
|
5
|
+
schema: {
|
|
6
|
+
readonly params: import("zod").ZodObject<{
|
|
7
|
+
albumid: import("zod").ZodString;
|
|
8
|
+
}, import("zod/v4/core").$strict>;
|
|
9
|
+
readonly response: import("zod").ZodArray<import("zod").ZodObject<{
|
|
10
|
+
id: import("zod").ZodString;
|
|
11
|
+
title: import("zod").ZodString;
|
|
12
|
+
subtitle: import("zod").ZodString;
|
|
13
|
+
type: import("zod").ZodLiteral<"album">;
|
|
14
|
+
image: import("zod").ZodString;
|
|
15
|
+
perma_url: import("zod").ZodString;
|
|
16
|
+
explicit_content: import("zod").ZodString;
|
|
17
|
+
header_desc: import("zod").ZodString;
|
|
18
|
+
language: import("zod").ZodString;
|
|
19
|
+
year: import("zod").ZodString;
|
|
20
|
+
play_count: import("zod").ZodString;
|
|
21
|
+
}, import("zod/v4/core").$loose>>;
|
|
22
|
+
};
|
|
23
|
+
mapper: (data: import("zod").infer<typeof SaavnGetRecoSchema.albums.response>) => {
|
|
24
|
+
id: string;
|
|
25
|
+
type: "album";
|
|
26
|
+
title: string;
|
|
27
|
+
subtitle: string;
|
|
28
|
+
description: string;
|
|
29
|
+
url: string;
|
|
30
|
+
images: import("../../..").Image[];
|
|
31
|
+
language: string;
|
|
32
|
+
year: number;
|
|
33
|
+
stats: {
|
|
34
|
+
playCount: number;
|
|
35
|
+
};
|
|
36
|
+
flags: {
|
|
37
|
+
isExplicit: boolean;
|
|
38
|
+
};
|
|
39
|
+
}[];
|
|
40
|
+
};
|
|
41
|
+
playlists: {
|
|
42
|
+
call: string;
|
|
43
|
+
schema: {
|
|
44
|
+
readonly params: import("zod").ZodObject<{
|
|
45
|
+
listid: import("zod").ZodString;
|
|
46
|
+
}, import("zod/v4/core").$strict>;
|
|
47
|
+
readonly response: import("zod").ZodArray<import("zod").ZodObject<{
|
|
48
|
+
id: import("zod").ZodString;
|
|
49
|
+
title: import("zod").ZodString;
|
|
50
|
+
subtitle: import("zod").ZodString;
|
|
51
|
+
type: import("zod").ZodLiteral<"playlist">;
|
|
52
|
+
image: import("zod").ZodString;
|
|
53
|
+
perma_url: import("zod").ZodString;
|
|
54
|
+
explicit_content: import("zod").ZodString;
|
|
55
|
+
more_info: import("zod").ZodObject<{
|
|
56
|
+
firstname: import("zod").ZodString;
|
|
57
|
+
}, import("zod/v4/core").$loose>;
|
|
58
|
+
}, import("zod/v4/core").$loose>>;
|
|
59
|
+
};
|
|
60
|
+
mapper: (data: import("zod").infer<typeof SaavnGetRecoSchema.playlists.response>) => {
|
|
61
|
+
id: string;
|
|
62
|
+
type: "playlist";
|
|
63
|
+
title: string;
|
|
64
|
+
subtitle: string;
|
|
65
|
+
url: string;
|
|
66
|
+
images: import("../../..").Image[];
|
|
67
|
+
flags: {
|
|
68
|
+
isExplicit: boolean;
|
|
69
|
+
};
|
|
70
|
+
owner: {
|
|
71
|
+
name: string;
|
|
72
|
+
};
|
|
73
|
+
}[];
|
|
74
|
+
};
|
|
75
|
+
songs: {
|
|
76
|
+
call: string;
|
|
77
|
+
schema: {
|
|
78
|
+
readonly params: import("zod").ZodObject<{
|
|
79
|
+
pid: import("zod").ZodString;
|
|
80
|
+
}, import("zod/v4/core").$strict>;
|
|
81
|
+
readonly response: import("zod").ZodArray<import("zod").ZodLazy<import("zod").ZodObject<{
|
|
82
|
+
id: import("zod").ZodString;
|
|
83
|
+
title: import("zod").ZodString;
|
|
84
|
+
subtitle: import("zod").ZodString;
|
|
85
|
+
type: import("zod").ZodLiteral<"song">;
|
|
86
|
+
perma_url: import("zod").ZodString;
|
|
87
|
+
image: import("zod").ZodString;
|
|
88
|
+
explicit_content: import("zod").ZodString;
|
|
89
|
+
header_desc: import("zod").ZodString;
|
|
90
|
+
language: import("zod").ZodString;
|
|
91
|
+
year: import("zod").ZodString;
|
|
92
|
+
play_count: import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodNumber]>;
|
|
93
|
+
more_info: import("zod").ZodObject<{
|
|
94
|
+
music: import("zod").ZodString;
|
|
95
|
+
album_id: import("zod").ZodString;
|
|
96
|
+
album: import("zod").ZodString;
|
|
97
|
+
label: import("zod").ZodString;
|
|
98
|
+
label_id: import("zod").ZodNullable<import("zod").ZodString>;
|
|
99
|
+
origin: import("zod").ZodString;
|
|
100
|
+
is_dolby_content: import("zod").ZodBoolean;
|
|
101
|
+
encrypted_media_url: import("zod").ZodString;
|
|
102
|
+
encrypted_drm_media_url: import("zod").ZodString;
|
|
103
|
+
album_url: import("zod").ZodString;
|
|
104
|
+
duration: import("zod").ZodString;
|
|
105
|
+
has_lyrics: import("zod").ZodString;
|
|
106
|
+
lyrics_snippet: import("zod").ZodString;
|
|
107
|
+
lyrics_id: import("zod").ZodOptional<import("zod").ZodString>;
|
|
108
|
+
copyright_text: import("zod").ZodString;
|
|
109
|
+
release_date: import("zod").ZodNullable<import("zod").ZodString>;
|
|
110
|
+
label_url: import("zod").ZodOptional<import("zod").ZodString>;
|
|
111
|
+
vcode: import("zod").ZodOptional<import("zod").ZodString>;
|
|
112
|
+
vlink: import("zod").ZodOptional<import("zod").ZodString>;
|
|
113
|
+
artistMap: import("zod").ZodLazy<import("zod").ZodObject<{
|
|
114
|
+
primary_artists: import("zod").ZodArray<import("zod").ZodObject<{
|
|
115
|
+
id: import("zod").ZodString;
|
|
116
|
+
name: import("zod").ZodString;
|
|
117
|
+
role: import("zod").ZodString;
|
|
118
|
+
image: import("zod").ZodString;
|
|
119
|
+
type: import("zod").ZodLiteral<"artist">;
|
|
120
|
+
perma_url: import("zod").ZodString;
|
|
121
|
+
}, import("zod/v4/core").$loose>>;
|
|
122
|
+
featured_artists: import("zod").ZodArray<import("zod").ZodObject<{
|
|
123
|
+
id: import("zod").ZodString;
|
|
124
|
+
name: import("zod").ZodString;
|
|
125
|
+
role: import("zod").ZodString;
|
|
126
|
+
image: import("zod").ZodString;
|
|
127
|
+
type: import("zod").ZodLiteral<"artist">;
|
|
128
|
+
perma_url: import("zod").ZodString;
|
|
129
|
+
}, import("zod/v4/core").$loose>>;
|
|
130
|
+
artists: import("zod").ZodArray<import("zod").ZodObject<{
|
|
131
|
+
id: import("zod").ZodString;
|
|
132
|
+
name: import("zod").ZodString;
|
|
133
|
+
role: import("zod").ZodString;
|
|
134
|
+
image: import("zod").ZodString;
|
|
135
|
+
type: import("zod").ZodLiteral<"artist">;
|
|
136
|
+
perma_url: import("zod").ZodString;
|
|
137
|
+
}, import("zod/v4/core").$loose>>;
|
|
138
|
+
}, import("zod/v4/core").$loose>>;
|
|
139
|
+
}, import("zod/v4/core").$loose>;
|
|
140
|
+
}, import("zod/v4/core").$loose>>>;
|
|
141
|
+
};
|
|
142
|
+
mapper: (data: import("zod").infer<typeof SaavnGetRecoSchema.songs.response>) => import("../../../core/models").Song[];
|
|
143
|
+
};
|
|
144
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { SaavnGetRecoMapper } from './mapper.ops';
|
|
2
|
+
import { SaavnGetRecoSchema } from './schema.ops';
|
|
3
|
+
export const SaavnGetReco = {
|
|
4
|
+
albums: {
|
|
5
|
+
call: 'reco.getAlbumReco',
|
|
6
|
+
schema: SaavnGetRecoSchema.albums,
|
|
7
|
+
mapper: SaavnGetRecoMapper.albums,
|
|
8
|
+
},
|
|
9
|
+
playlists: {
|
|
10
|
+
call: 'reco.getPlaylistReco',
|
|
11
|
+
schema: SaavnGetRecoSchema.playlists,
|
|
12
|
+
mapper: SaavnGetRecoMapper.playlists,
|
|
13
|
+
},
|
|
14
|
+
songs: {
|
|
15
|
+
call: 'reco.getreco',
|
|
16
|
+
schema: SaavnGetRecoSchema.songs,
|
|
17
|
+
mapper: SaavnGetRecoMapper.songs,
|
|
18
|
+
},
|
|
19
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { SaavnGetRecoSchema } from './schema.ops';
|
|
3
|
+
export declare const SaavnGetRecoMapper: {
|
|
4
|
+
albums: (data: z.infer<typeof SaavnGetRecoSchema.albums.response>) => {
|
|
5
|
+
id: string;
|
|
6
|
+
type: "album";
|
|
7
|
+
title: string;
|
|
8
|
+
subtitle: string;
|
|
9
|
+
description: string;
|
|
10
|
+
url: string;
|
|
11
|
+
images: import("../../..").Image[];
|
|
12
|
+
language: string;
|
|
13
|
+
year: number;
|
|
14
|
+
stats: {
|
|
15
|
+
playCount: number;
|
|
16
|
+
};
|
|
17
|
+
flags: {
|
|
18
|
+
isExplicit: boolean;
|
|
19
|
+
};
|
|
20
|
+
}[];
|
|
21
|
+
playlists: (data: z.infer<typeof SaavnGetRecoSchema.playlists.response>) => {
|
|
22
|
+
id: string;
|
|
23
|
+
type: "playlist";
|
|
24
|
+
title: string;
|
|
25
|
+
subtitle: string;
|
|
26
|
+
url: string;
|
|
27
|
+
images: import("../../..").Image[];
|
|
28
|
+
flags: {
|
|
29
|
+
isExplicit: boolean;
|
|
30
|
+
};
|
|
31
|
+
owner: {
|
|
32
|
+
name: string;
|
|
33
|
+
};
|
|
34
|
+
}[];
|
|
35
|
+
songs: (data: z.infer<typeof SaavnGetRecoSchema.songs.response>) => import("../../../core/models").Song[];
|
|
36
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { mapSong, parseImageUrls, mapArtist } from '../../common-mapper';
|
|
3
|
+
import { SaavnGetRecoSchema } from './schema.ops';
|
|
4
|
+
export const SaavnGetRecoMapper = {
|
|
5
|
+
albums: (data) => {
|
|
6
|
+
return data.map((album) => ({
|
|
7
|
+
id: album.id,
|
|
8
|
+
type: 'album',
|
|
9
|
+
title: album.title,
|
|
10
|
+
subtitle: album.subtitle,
|
|
11
|
+
description: album.header_desc,
|
|
12
|
+
url: album.perma_url,
|
|
13
|
+
images: parseImageUrls(album.image),
|
|
14
|
+
language: album.language,
|
|
15
|
+
year: parseInt(album.year, 10),
|
|
16
|
+
stats: {
|
|
17
|
+
playCount: parseInt(album.play_count, 10),
|
|
18
|
+
},
|
|
19
|
+
flags: {
|
|
20
|
+
isExplicit: album.explicit_content === '1',
|
|
21
|
+
},
|
|
22
|
+
}));
|
|
23
|
+
},
|
|
24
|
+
playlists: (data) => {
|
|
25
|
+
return data.map((playlist) => ({
|
|
26
|
+
id: playlist.id,
|
|
27
|
+
type: 'playlist',
|
|
28
|
+
title: playlist.title,
|
|
29
|
+
subtitle: playlist.subtitle,
|
|
30
|
+
url: playlist.perma_url,
|
|
31
|
+
images: parseImageUrls(playlist.image),
|
|
32
|
+
flags: {
|
|
33
|
+
isExplicit: playlist.explicit_content === '1',
|
|
34
|
+
},
|
|
35
|
+
owner: {
|
|
36
|
+
name: playlist.more_info?.firstname,
|
|
37
|
+
},
|
|
38
|
+
}));
|
|
39
|
+
},
|
|
40
|
+
songs: (data) => {
|
|
41
|
+
return data.map(mapSong);
|
|
42
|
+
},
|
|
43
|
+
};
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const SaavnGetRecoSchema: {
|
|
3
|
+
readonly albums: {
|
|
4
|
+
readonly params: z.ZodObject<{
|
|
5
|
+
albumid: z.ZodString;
|
|
6
|
+
}, z.core.$strict>;
|
|
7
|
+
readonly response: z.ZodArray<z.ZodObject<{
|
|
8
|
+
id: z.ZodString;
|
|
9
|
+
title: z.ZodString;
|
|
10
|
+
subtitle: z.ZodString;
|
|
11
|
+
type: z.ZodLiteral<"album">;
|
|
12
|
+
image: z.ZodString;
|
|
13
|
+
perma_url: z.ZodString;
|
|
14
|
+
explicit_content: z.ZodString;
|
|
15
|
+
header_desc: z.ZodString;
|
|
16
|
+
language: z.ZodString;
|
|
17
|
+
year: z.ZodString;
|
|
18
|
+
play_count: z.ZodString;
|
|
19
|
+
}, z.core.$loose>>;
|
|
20
|
+
};
|
|
21
|
+
readonly playlists: {
|
|
22
|
+
readonly params: z.ZodObject<{
|
|
23
|
+
listid: z.ZodString;
|
|
24
|
+
}, z.core.$strict>;
|
|
25
|
+
readonly response: z.ZodArray<z.ZodObject<{
|
|
26
|
+
id: z.ZodString;
|
|
27
|
+
title: z.ZodString;
|
|
28
|
+
subtitle: z.ZodString;
|
|
29
|
+
type: z.ZodLiteral<"playlist">;
|
|
30
|
+
image: z.ZodString;
|
|
31
|
+
perma_url: z.ZodString;
|
|
32
|
+
explicit_content: z.ZodString;
|
|
33
|
+
more_info: z.ZodObject<{
|
|
34
|
+
firstname: z.ZodString;
|
|
35
|
+
}, z.core.$loose>;
|
|
36
|
+
}, z.core.$loose>>;
|
|
37
|
+
};
|
|
38
|
+
readonly songs: {
|
|
39
|
+
readonly params: z.ZodObject<{
|
|
40
|
+
pid: z.ZodString;
|
|
41
|
+
}, z.core.$strict>;
|
|
42
|
+
readonly response: z.ZodArray<z.ZodLazy<z.ZodObject<{
|
|
43
|
+
id: z.ZodString;
|
|
44
|
+
title: z.ZodString;
|
|
45
|
+
subtitle: z.ZodString;
|
|
46
|
+
type: z.ZodLiteral<"song">;
|
|
47
|
+
perma_url: z.ZodString;
|
|
48
|
+
image: z.ZodString;
|
|
49
|
+
explicit_content: z.ZodString;
|
|
50
|
+
header_desc: z.ZodString;
|
|
51
|
+
language: z.ZodString;
|
|
52
|
+
year: z.ZodString;
|
|
53
|
+
play_count: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
|
|
54
|
+
more_info: z.ZodObject<{
|
|
55
|
+
music: z.ZodString;
|
|
56
|
+
album_id: z.ZodString;
|
|
57
|
+
album: z.ZodString;
|
|
58
|
+
label: z.ZodString;
|
|
59
|
+
label_id: z.ZodNullable<z.ZodString>;
|
|
60
|
+
origin: z.ZodString;
|
|
61
|
+
is_dolby_content: z.ZodBoolean;
|
|
62
|
+
encrypted_media_url: z.ZodString;
|
|
63
|
+
encrypted_drm_media_url: z.ZodString;
|
|
64
|
+
album_url: z.ZodString;
|
|
65
|
+
duration: z.ZodString;
|
|
66
|
+
has_lyrics: z.ZodString;
|
|
67
|
+
lyrics_snippet: z.ZodString;
|
|
68
|
+
lyrics_id: z.ZodOptional<z.ZodString>;
|
|
69
|
+
copyright_text: z.ZodString;
|
|
70
|
+
release_date: z.ZodNullable<z.ZodString>;
|
|
71
|
+
label_url: z.ZodOptional<z.ZodString>;
|
|
72
|
+
vcode: z.ZodOptional<z.ZodString>;
|
|
73
|
+
vlink: z.ZodOptional<z.ZodString>;
|
|
74
|
+
artistMap: z.ZodLazy<z.ZodObject<{
|
|
75
|
+
primary_artists: z.ZodArray<z.ZodObject<{
|
|
76
|
+
id: z.ZodString;
|
|
77
|
+
name: z.ZodString;
|
|
78
|
+
role: z.ZodString;
|
|
79
|
+
image: z.ZodString;
|
|
80
|
+
type: z.ZodLiteral<"artist">;
|
|
81
|
+
perma_url: z.ZodString;
|
|
82
|
+
}, z.core.$loose>>;
|
|
83
|
+
featured_artists: z.ZodArray<z.ZodObject<{
|
|
84
|
+
id: z.ZodString;
|
|
85
|
+
name: z.ZodString;
|
|
86
|
+
role: z.ZodString;
|
|
87
|
+
image: z.ZodString;
|
|
88
|
+
type: z.ZodLiteral<"artist">;
|
|
89
|
+
perma_url: z.ZodString;
|
|
90
|
+
}, z.core.$loose>>;
|
|
91
|
+
artists: z.ZodArray<z.ZodObject<{
|
|
92
|
+
id: z.ZodString;
|
|
93
|
+
name: z.ZodString;
|
|
94
|
+
role: z.ZodString;
|
|
95
|
+
image: z.ZodString;
|
|
96
|
+
type: z.ZodLiteral<"artist">;
|
|
97
|
+
perma_url: z.ZodString;
|
|
98
|
+
}, z.core.$loose>>;
|
|
99
|
+
}, z.core.$loose>>;
|
|
100
|
+
}, z.core.$loose>;
|
|
101
|
+
}, z.core.$loose>>>;
|
|
102
|
+
};
|
|
103
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { NonEmptyString, PositiveString } from '../../primitives/string';
|
|
3
|
+
import { SaavnAlbumBase, SaavnPlaylistBase } from '../../entities/base';
|
|
4
|
+
import { SaavnSongEntity } from '../../entities';
|
|
5
|
+
export const SaavnGetRecoSchema = {
|
|
6
|
+
albums: {
|
|
7
|
+
params: z.strictObject({
|
|
8
|
+
albumid: PositiveString,
|
|
9
|
+
}),
|
|
10
|
+
response: z.array(SaavnAlbumBase),
|
|
11
|
+
},
|
|
12
|
+
playlists: {
|
|
13
|
+
params: z.strictObject({
|
|
14
|
+
listid: PositiveString,
|
|
15
|
+
}),
|
|
16
|
+
response: z.array(SaavnPlaylistBase.extend({
|
|
17
|
+
more_info: z.looseObject({
|
|
18
|
+
firstname: z.string(),
|
|
19
|
+
}),
|
|
20
|
+
})),
|
|
21
|
+
},
|
|
22
|
+
songs: {
|
|
23
|
+
params: z.strictObject({
|
|
24
|
+
pid: NonEmptyString,
|
|
25
|
+
}),
|
|
26
|
+
response: z.array(z.lazy(() => SaavnSongEntity)),
|
|
27
|
+
},
|
|
28
|
+
};
|