@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,366 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const SaavnSearchResultsSchema: {
|
|
3
|
+
readonly all: {
|
|
4
|
+
readonly params: z.ZodObject<{
|
|
5
|
+
query: z.ZodString;
|
|
6
|
+
}, z.core.$strict>;
|
|
7
|
+
readonly response: z.ZodObject<{
|
|
8
|
+
albums: z.ZodObject<{
|
|
9
|
+
position: z.ZodNumber;
|
|
10
|
+
data: z.ZodArray<z.ZodObject<{
|
|
11
|
+
id: z.ZodString;
|
|
12
|
+
title: z.ZodString;
|
|
13
|
+
subtitle: z.ZodString;
|
|
14
|
+
type: z.ZodLiteral<"album">;
|
|
15
|
+
image: z.ZodString;
|
|
16
|
+
perma_url: z.ZodString;
|
|
17
|
+
explicit_content: z.ZodString;
|
|
18
|
+
description: z.ZodString;
|
|
19
|
+
more_info: z.ZodObject<{
|
|
20
|
+
music: z.ZodNullable<z.ZodString>;
|
|
21
|
+
ctr: z.ZodNumber;
|
|
22
|
+
year: z.ZodString;
|
|
23
|
+
language: z.ZodString;
|
|
24
|
+
song_pids: z.ZodString;
|
|
25
|
+
}, z.core.$loose>;
|
|
26
|
+
}, z.core.$loose>>;
|
|
27
|
+
}, z.core.$loose>;
|
|
28
|
+
artists: z.ZodObject<{
|
|
29
|
+
position: z.ZodNumber;
|
|
30
|
+
data: z.ZodArray<z.ZodObject<{
|
|
31
|
+
id: z.ZodString;
|
|
32
|
+
title: z.ZodString;
|
|
33
|
+
image: z.ZodString;
|
|
34
|
+
type: z.ZodLiteral<"artist">;
|
|
35
|
+
isRadioPresent: z.ZodBoolean;
|
|
36
|
+
ctr: z.ZodNumber;
|
|
37
|
+
description: z.ZodString;
|
|
38
|
+
position: z.ZodNumber;
|
|
39
|
+
}, z.core.$loose>>;
|
|
40
|
+
}, z.core.$loose>;
|
|
41
|
+
playlists: z.ZodObject<{
|
|
42
|
+
position: z.ZodNumber;
|
|
43
|
+
data: z.ZodArray<z.ZodObject<{
|
|
44
|
+
id: z.ZodString;
|
|
45
|
+
title: z.ZodString;
|
|
46
|
+
subtitle: z.ZodString;
|
|
47
|
+
type: z.ZodLiteral<"playlist">;
|
|
48
|
+
image: z.ZodString;
|
|
49
|
+
perma_url: z.ZodString;
|
|
50
|
+
explicit_content: z.ZodString;
|
|
51
|
+
description: z.ZodString;
|
|
52
|
+
more_info: z.ZodObject<{
|
|
53
|
+
firstname: z.ZodString;
|
|
54
|
+
lastname: z.ZodOptional<z.ZodString>;
|
|
55
|
+
artist_name: z.ZodNullable<z.ZodArray<z.ZodString>>;
|
|
56
|
+
entity_type: z.ZodString;
|
|
57
|
+
is_dolby_content: z.ZodNullable<z.ZodBoolean>;
|
|
58
|
+
language: z.ZodString;
|
|
59
|
+
}, z.core.$loose>;
|
|
60
|
+
}, z.core.$loose>>;
|
|
61
|
+
}, z.core.$loose>;
|
|
62
|
+
shows: z.ZodObject<{
|
|
63
|
+
position: z.ZodNumber;
|
|
64
|
+
data: z.ZodArray<z.ZodObject<{
|
|
65
|
+
id: z.ZodString;
|
|
66
|
+
title: z.ZodString;
|
|
67
|
+
subtitle: z.ZodString;
|
|
68
|
+
type: z.ZodLiteral<"show">;
|
|
69
|
+
image: z.ZodString;
|
|
70
|
+
perma_url: z.ZodString;
|
|
71
|
+
more_info: z.ZodObject<{
|
|
72
|
+
season_number: z.ZodNumber;
|
|
73
|
+
}, z.core.$loose>;
|
|
74
|
+
explicit_content: z.ZodString;
|
|
75
|
+
description: z.ZodString;
|
|
76
|
+
}, z.core.$loose>>;
|
|
77
|
+
}, z.core.$loose>;
|
|
78
|
+
songs: z.ZodObject<{
|
|
79
|
+
position: z.ZodNumber;
|
|
80
|
+
data: z.ZodArray<z.ZodObject<{
|
|
81
|
+
id: z.ZodString;
|
|
82
|
+
title: z.ZodString;
|
|
83
|
+
subtitle: z.ZodString;
|
|
84
|
+
type: z.ZodLiteral<"song">;
|
|
85
|
+
perma_url: z.ZodString;
|
|
86
|
+
image: z.ZodString;
|
|
87
|
+
explicit_content: z.ZodString;
|
|
88
|
+
description: z.ZodString;
|
|
89
|
+
more_info: z.ZodObject<{
|
|
90
|
+
album: z.ZodString;
|
|
91
|
+
album_id: z.ZodString;
|
|
92
|
+
ctr: z.ZodNumber;
|
|
93
|
+
score: z.ZodString;
|
|
94
|
+
vcode: z.ZodString;
|
|
95
|
+
vlink: z.ZodString;
|
|
96
|
+
primary_artists: z.ZodString;
|
|
97
|
+
singers: z.ZodString;
|
|
98
|
+
language: z.ZodString;
|
|
99
|
+
}, z.core.$loose>;
|
|
100
|
+
}, z.core.$loose>>;
|
|
101
|
+
}, z.core.$loose>;
|
|
102
|
+
episodes: z.ZodObject<{
|
|
103
|
+
position: z.ZodNumber;
|
|
104
|
+
data: z.ZodArray<z.ZodAny>;
|
|
105
|
+
}, z.core.$loose>;
|
|
106
|
+
topquery: z.ZodObject<{
|
|
107
|
+
position: z.ZodNumber;
|
|
108
|
+
data: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
109
|
+
id: z.ZodString;
|
|
110
|
+
title: z.ZodString;
|
|
111
|
+
subtitle: z.ZodString;
|
|
112
|
+
type: z.ZodLiteral<"album">;
|
|
113
|
+
image: z.ZodString;
|
|
114
|
+
perma_url: z.ZodString;
|
|
115
|
+
explicit_content: z.ZodString;
|
|
116
|
+
description: z.ZodString;
|
|
117
|
+
more_info: z.ZodObject<{
|
|
118
|
+
music: z.ZodNullable<z.ZodString>;
|
|
119
|
+
ctr: z.ZodNumber;
|
|
120
|
+
year: z.ZodString;
|
|
121
|
+
language: z.ZodString;
|
|
122
|
+
song_pids: z.ZodString;
|
|
123
|
+
}, z.core.$loose>;
|
|
124
|
+
}, z.core.$loose>, z.ZodObject<{
|
|
125
|
+
id: z.ZodString;
|
|
126
|
+
title: z.ZodString;
|
|
127
|
+
image: z.ZodString;
|
|
128
|
+
type: z.ZodLiteral<"artist">;
|
|
129
|
+
isRadioPresent: z.ZodBoolean;
|
|
130
|
+
ctr: z.ZodNumber;
|
|
131
|
+
description: z.ZodString;
|
|
132
|
+
position: z.ZodNumber;
|
|
133
|
+
}, z.core.$loose>, z.ZodObject<{
|
|
134
|
+
id: z.ZodString;
|
|
135
|
+
title: z.ZodString;
|
|
136
|
+
subtitle: z.ZodString;
|
|
137
|
+
type: z.ZodLiteral<"playlist">;
|
|
138
|
+
image: z.ZodString;
|
|
139
|
+
perma_url: z.ZodString;
|
|
140
|
+
explicit_content: z.ZodString;
|
|
141
|
+
description: z.ZodString;
|
|
142
|
+
more_info: z.ZodObject<{
|
|
143
|
+
firstname: z.ZodString;
|
|
144
|
+
lastname: z.ZodOptional<z.ZodString>;
|
|
145
|
+
artist_name: z.ZodNullable<z.ZodArray<z.ZodString>>;
|
|
146
|
+
entity_type: z.ZodString;
|
|
147
|
+
is_dolby_content: z.ZodNullable<z.ZodBoolean>;
|
|
148
|
+
language: z.ZodString;
|
|
149
|
+
}, z.core.$loose>;
|
|
150
|
+
}, z.core.$loose>, z.ZodObject<{
|
|
151
|
+
id: z.ZodString;
|
|
152
|
+
title: z.ZodString;
|
|
153
|
+
subtitle: z.ZodString;
|
|
154
|
+
type: z.ZodLiteral<"song">;
|
|
155
|
+
perma_url: z.ZodString;
|
|
156
|
+
image: z.ZodString;
|
|
157
|
+
explicit_content: z.ZodString;
|
|
158
|
+
description: z.ZodString;
|
|
159
|
+
more_info: z.ZodObject<{
|
|
160
|
+
album: z.ZodString;
|
|
161
|
+
album_id: z.ZodString;
|
|
162
|
+
ctr: z.ZodNumber;
|
|
163
|
+
score: z.ZodString;
|
|
164
|
+
vcode: z.ZodString;
|
|
165
|
+
vlink: z.ZodString;
|
|
166
|
+
primary_artists: z.ZodString;
|
|
167
|
+
singers: z.ZodString;
|
|
168
|
+
language: z.ZodString;
|
|
169
|
+
}, z.core.$loose>;
|
|
170
|
+
}, z.core.$loose>, z.ZodObject<{
|
|
171
|
+
id: z.ZodString;
|
|
172
|
+
title: z.ZodString;
|
|
173
|
+
subtitle: z.ZodString;
|
|
174
|
+
type: z.ZodLiteral<"show">;
|
|
175
|
+
image: z.ZodString;
|
|
176
|
+
perma_url: z.ZodString;
|
|
177
|
+
more_info: z.ZodObject<{
|
|
178
|
+
season_number: z.ZodNumber;
|
|
179
|
+
}, z.core.$loose>;
|
|
180
|
+
explicit_content: z.ZodString;
|
|
181
|
+
description: z.ZodString;
|
|
182
|
+
}, z.core.$loose>], "type">>;
|
|
183
|
+
}, z.core.$loose>;
|
|
184
|
+
}, z.core.$loose>;
|
|
185
|
+
};
|
|
186
|
+
readonly albums: {
|
|
187
|
+
readonly params: z.ZodObject<{
|
|
188
|
+
q: z.ZodString;
|
|
189
|
+
p: z.ZodOptional<z.ZodString>;
|
|
190
|
+
n: z.ZodOptional<z.ZodString>;
|
|
191
|
+
}, z.core.$strict>;
|
|
192
|
+
readonly response: z.ZodObject<{
|
|
193
|
+
total: z.ZodNumber;
|
|
194
|
+
start: z.ZodNumber;
|
|
195
|
+
results: z.ZodArray<z.ZodObject<{
|
|
196
|
+
id: z.ZodString;
|
|
197
|
+
title: z.ZodString;
|
|
198
|
+
subtitle: z.ZodString;
|
|
199
|
+
type: z.ZodLiteral<"album">;
|
|
200
|
+
image: z.ZodString;
|
|
201
|
+
perma_url: z.ZodString;
|
|
202
|
+
explicit_content: z.ZodString;
|
|
203
|
+
header_desc: z.ZodString;
|
|
204
|
+
language: z.ZodString;
|
|
205
|
+
year: z.ZodString;
|
|
206
|
+
play_count: z.ZodString;
|
|
207
|
+
more_info: z.ZodObject<{
|
|
208
|
+
query: z.ZodString;
|
|
209
|
+
text: z.ZodString;
|
|
210
|
+
music: z.ZodNullable<z.ZodString>;
|
|
211
|
+
song_count: z.ZodString;
|
|
212
|
+
artistMap: z.ZodObject<{
|
|
213
|
+
primary_artists: z.ZodArray<z.ZodObject<{
|
|
214
|
+
id: z.ZodString;
|
|
215
|
+
name: z.ZodString;
|
|
216
|
+
role: z.ZodString;
|
|
217
|
+
image: z.ZodString;
|
|
218
|
+
type: z.ZodLiteral<"artist">;
|
|
219
|
+
perma_url: z.ZodString;
|
|
220
|
+
}, z.core.$loose>>;
|
|
221
|
+
featured_artists: z.ZodArray<z.ZodObject<{
|
|
222
|
+
id: z.ZodString;
|
|
223
|
+
name: z.ZodString;
|
|
224
|
+
role: z.ZodString;
|
|
225
|
+
image: z.ZodString;
|
|
226
|
+
type: z.ZodLiteral<"artist">;
|
|
227
|
+
perma_url: z.ZodString;
|
|
228
|
+
}, z.core.$loose>>;
|
|
229
|
+
artists: z.ZodArray<z.ZodObject<{
|
|
230
|
+
id: z.ZodString;
|
|
231
|
+
name: z.ZodString;
|
|
232
|
+
role: z.ZodString;
|
|
233
|
+
image: z.ZodString;
|
|
234
|
+
type: z.ZodLiteral<"artist">;
|
|
235
|
+
perma_url: z.ZodString;
|
|
236
|
+
}, z.core.$loose>>;
|
|
237
|
+
}, z.core.$loose>;
|
|
238
|
+
}, z.core.$loose>;
|
|
239
|
+
}, z.core.$loose>>;
|
|
240
|
+
}, z.core.$loose>;
|
|
241
|
+
};
|
|
242
|
+
readonly artists: {
|
|
243
|
+
readonly params: z.ZodObject<{
|
|
244
|
+
q: z.ZodString;
|
|
245
|
+
p: z.ZodOptional<z.ZodString>;
|
|
246
|
+
n: z.ZodOptional<z.ZodString>;
|
|
247
|
+
}, z.core.$strict>;
|
|
248
|
+
readonly response: z.ZodObject<{
|
|
249
|
+
total: z.ZodNumber;
|
|
250
|
+
start: z.ZodNumber;
|
|
251
|
+
results: z.ZodArray<z.ZodObject<{
|
|
252
|
+
id: z.ZodString;
|
|
253
|
+
name: z.ZodString;
|
|
254
|
+
role: z.ZodString;
|
|
255
|
+
image: z.ZodString;
|
|
256
|
+
type: z.ZodLiteral<"artist">;
|
|
257
|
+
perma_url: z.ZodString;
|
|
258
|
+
ctr: z.ZodNumber;
|
|
259
|
+
entity: z.ZodNumber;
|
|
260
|
+
isRadioPresent: z.ZodBoolean;
|
|
261
|
+
is_followed: z.ZodBoolean;
|
|
262
|
+
}, z.core.$loose>>;
|
|
263
|
+
}, z.core.$loose>;
|
|
264
|
+
};
|
|
265
|
+
readonly playlists: {
|
|
266
|
+
readonly params: z.ZodObject<{
|
|
267
|
+
q: z.ZodString;
|
|
268
|
+
p: z.ZodOptional<z.ZodString>;
|
|
269
|
+
n: z.ZodOptional<z.ZodString>;
|
|
270
|
+
}, z.core.$strict>;
|
|
271
|
+
readonly response: z.ZodObject<{
|
|
272
|
+
total: z.ZodNumber;
|
|
273
|
+
start: z.ZodNumber;
|
|
274
|
+
results: z.ZodArray<z.ZodObject<{
|
|
275
|
+
id: z.ZodString;
|
|
276
|
+
title: z.ZodString;
|
|
277
|
+
subtitle: z.ZodString;
|
|
278
|
+
type: z.ZodLiteral<"playlist">;
|
|
279
|
+
image: z.ZodString;
|
|
280
|
+
perma_url: z.ZodString;
|
|
281
|
+
explicit_content: z.ZodString;
|
|
282
|
+
more_info: z.ZodObject<{
|
|
283
|
+
firstname: z.ZodString;
|
|
284
|
+
lastname: z.ZodOptional<z.ZodString>;
|
|
285
|
+
artist_name: z.ZodNullable<z.ZodArray<z.ZodString>>;
|
|
286
|
+
entity_type: z.ZodString;
|
|
287
|
+
is_dolby_content: z.ZodNullable<z.ZodBoolean>;
|
|
288
|
+
language: z.ZodString;
|
|
289
|
+
uid: z.ZodString;
|
|
290
|
+
song_count: z.ZodString;
|
|
291
|
+
}, z.core.$loose>;
|
|
292
|
+
}, z.core.$loose>>;
|
|
293
|
+
}, z.core.$loose>;
|
|
294
|
+
};
|
|
295
|
+
readonly songs: {
|
|
296
|
+
readonly params: z.ZodObject<{
|
|
297
|
+
q: z.ZodString;
|
|
298
|
+
p: z.ZodOptional<z.ZodString>;
|
|
299
|
+
n: z.ZodOptional<z.ZodString>;
|
|
300
|
+
}, z.core.$strict>;
|
|
301
|
+
readonly response: z.ZodObject<{
|
|
302
|
+
total: z.ZodNumber;
|
|
303
|
+
start: z.ZodNumber;
|
|
304
|
+
results: z.ZodArray<z.ZodObject<{
|
|
305
|
+
id: z.ZodString;
|
|
306
|
+
title: z.ZodString;
|
|
307
|
+
subtitle: z.ZodString;
|
|
308
|
+
type: z.ZodLiteral<"song">;
|
|
309
|
+
perma_url: z.ZodString;
|
|
310
|
+
image: z.ZodString;
|
|
311
|
+
explicit_content: z.ZodString;
|
|
312
|
+
header_desc: z.ZodString;
|
|
313
|
+
language: z.ZodString;
|
|
314
|
+
year: z.ZodString;
|
|
315
|
+
play_count: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
|
|
316
|
+
more_info: z.ZodObject<{
|
|
317
|
+
music: z.ZodString;
|
|
318
|
+
album_id: z.ZodString;
|
|
319
|
+
album: z.ZodString;
|
|
320
|
+
label: z.ZodString;
|
|
321
|
+
label_id: z.ZodNullable<z.ZodString>;
|
|
322
|
+
origin: z.ZodString;
|
|
323
|
+
is_dolby_content: z.ZodBoolean;
|
|
324
|
+
encrypted_media_url: z.ZodString;
|
|
325
|
+
encrypted_drm_media_url: z.ZodString;
|
|
326
|
+
album_url: z.ZodString;
|
|
327
|
+
duration: z.ZodString;
|
|
328
|
+
has_lyrics: z.ZodString;
|
|
329
|
+
lyrics_snippet: z.ZodString;
|
|
330
|
+
lyrics_id: z.ZodOptional<z.ZodString>;
|
|
331
|
+
copyright_text: z.ZodString;
|
|
332
|
+
release_date: z.ZodNullable<z.ZodString>;
|
|
333
|
+
label_url: z.ZodOptional<z.ZodString>;
|
|
334
|
+
vcode: z.ZodOptional<z.ZodString>;
|
|
335
|
+
vlink: z.ZodOptional<z.ZodString>;
|
|
336
|
+
artistMap: z.ZodLazy<z.ZodObject<{
|
|
337
|
+
primary_artists: z.ZodArray<z.ZodObject<{
|
|
338
|
+
id: z.ZodString;
|
|
339
|
+
name: z.ZodString;
|
|
340
|
+
role: z.ZodString;
|
|
341
|
+
image: z.ZodString;
|
|
342
|
+
type: z.ZodLiteral<"artist">;
|
|
343
|
+
perma_url: z.ZodString;
|
|
344
|
+
}, z.core.$loose>>;
|
|
345
|
+
featured_artists: z.ZodArray<z.ZodObject<{
|
|
346
|
+
id: z.ZodString;
|
|
347
|
+
name: z.ZodString;
|
|
348
|
+
role: z.ZodString;
|
|
349
|
+
image: z.ZodString;
|
|
350
|
+
type: z.ZodLiteral<"artist">;
|
|
351
|
+
perma_url: z.ZodString;
|
|
352
|
+
}, z.core.$loose>>;
|
|
353
|
+
artists: z.ZodArray<z.ZodObject<{
|
|
354
|
+
id: z.ZodString;
|
|
355
|
+
name: z.ZodString;
|
|
356
|
+
role: z.ZodString;
|
|
357
|
+
image: z.ZodString;
|
|
358
|
+
type: z.ZodLiteral<"artist">;
|
|
359
|
+
perma_url: z.ZodString;
|
|
360
|
+
}, z.core.$loose>>;
|
|
361
|
+
}, z.core.$loose>>;
|
|
362
|
+
}, z.core.$loose>;
|
|
363
|
+
}, z.core.$loose>>;
|
|
364
|
+
}, z.core.$loose>;
|
|
365
|
+
};
|
|
366
|
+
};
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { NonEmptyString, PositiveString } from '../../primitives/string';
|
|
3
|
+
import { SaavnArtistBase } from '../../entities/base';
|
|
4
|
+
import { SaavnAlbumEdgeCase, SaavnPlaylistEdgeCase, SaavnSongEntity, SaavnSearchAlbumEntity, SaavnArtistSearchEntity, SaavnPlaylistSearchEntity, SaavnSongSearchEntity, SaavnShowEntity, } from '../../entities';
|
|
5
|
+
const PageString = z.string().regex(/^\d+$/);
|
|
6
|
+
export const SaavnSearchResultsSchema = {
|
|
7
|
+
all: {
|
|
8
|
+
params: z.strictObject({
|
|
9
|
+
query: NonEmptyString,
|
|
10
|
+
}),
|
|
11
|
+
response: z.looseObject({
|
|
12
|
+
albums: z.looseObject({
|
|
13
|
+
position: z.number(),
|
|
14
|
+
data: z.array(SaavnSearchAlbumEntity),
|
|
15
|
+
}),
|
|
16
|
+
artists: z.looseObject({
|
|
17
|
+
position: z.number(),
|
|
18
|
+
data: z.array(SaavnArtistSearchEntity),
|
|
19
|
+
}),
|
|
20
|
+
playlists: z.looseObject({
|
|
21
|
+
position: z.number(),
|
|
22
|
+
data: z.array(SaavnPlaylistSearchEntity),
|
|
23
|
+
}),
|
|
24
|
+
shows: z.looseObject({
|
|
25
|
+
position: z.number(),
|
|
26
|
+
data: z.array(SaavnShowEntity),
|
|
27
|
+
}),
|
|
28
|
+
songs: z.looseObject({
|
|
29
|
+
position: z.number(),
|
|
30
|
+
data: z.array(SaavnSongSearchEntity),
|
|
31
|
+
}),
|
|
32
|
+
episodes: z.looseObject({
|
|
33
|
+
position: z.number(),
|
|
34
|
+
data: z.array(z.any()),
|
|
35
|
+
}),
|
|
36
|
+
topquery: z.looseObject({
|
|
37
|
+
position: z.number(),
|
|
38
|
+
data: z.array(z.discriminatedUnion('type', [
|
|
39
|
+
SaavnSearchAlbumEntity,
|
|
40
|
+
SaavnArtistSearchEntity,
|
|
41
|
+
SaavnPlaylistSearchEntity,
|
|
42
|
+
SaavnSongSearchEntity,
|
|
43
|
+
SaavnShowEntity,
|
|
44
|
+
])),
|
|
45
|
+
}),
|
|
46
|
+
}),
|
|
47
|
+
},
|
|
48
|
+
albums: {
|
|
49
|
+
params: z.strictObject({
|
|
50
|
+
q: NonEmptyString,
|
|
51
|
+
p: PageString.optional(),
|
|
52
|
+
n: PositiveString.optional(),
|
|
53
|
+
}),
|
|
54
|
+
response: z.looseObject({
|
|
55
|
+
total: z.number(),
|
|
56
|
+
start: z.number(),
|
|
57
|
+
results: z.array(SaavnAlbumEdgeCase),
|
|
58
|
+
}),
|
|
59
|
+
},
|
|
60
|
+
artists: {
|
|
61
|
+
params: z.strictObject({
|
|
62
|
+
q: NonEmptyString,
|
|
63
|
+
p: PageString.optional(),
|
|
64
|
+
n: PositiveString.optional(),
|
|
65
|
+
}),
|
|
66
|
+
response: z.looseObject({
|
|
67
|
+
total: z.number(),
|
|
68
|
+
start: z.number(),
|
|
69
|
+
results: z.array(SaavnArtistBase.extend({
|
|
70
|
+
ctr: z.number(),
|
|
71
|
+
entity: z.number(),
|
|
72
|
+
isRadioPresent: z.boolean(),
|
|
73
|
+
is_followed: z.boolean(),
|
|
74
|
+
})),
|
|
75
|
+
}),
|
|
76
|
+
},
|
|
77
|
+
playlists: {
|
|
78
|
+
params: z.strictObject({
|
|
79
|
+
q: NonEmptyString,
|
|
80
|
+
p: PageString.optional(),
|
|
81
|
+
n: PositiveString.optional(),
|
|
82
|
+
}),
|
|
83
|
+
response: z.looseObject({
|
|
84
|
+
total: z.number(),
|
|
85
|
+
start: z.number(),
|
|
86
|
+
results: z.array(SaavnPlaylistEdgeCase),
|
|
87
|
+
}),
|
|
88
|
+
},
|
|
89
|
+
songs: {
|
|
90
|
+
params: z.strictObject({
|
|
91
|
+
q: NonEmptyString,
|
|
92
|
+
p: PageString.optional(),
|
|
93
|
+
n: PositiveString.optional(),
|
|
94
|
+
}),
|
|
95
|
+
response: z.looseObject({
|
|
96
|
+
total: z.number(),
|
|
97
|
+
start: z.number(),
|
|
98
|
+
results: z.array(SaavnSongEntity),
|
|
99
|
+
}),
|
|
100
|
+
},
|
|
101
|
+
};
|