@saavn-labs/sdk 0.1.0 → 0.1.2
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/README.md +27 -21
- package/dist/core/models/album.d.ts +1 -1
- package/dist/core/models/artist.d.ts +1 -1
- package/dist/core/models/index.d.ts +4 -4
- package/dist/core/models/index.js +4 -4
- package/dist/core/models/playlist.d.ts +1 -1
- package/dist/core/models/song.d.ts +1 -1
- package/dist/core/modules/album.module.js +4 -4
- package/dist/core/modules/artist.module.js +4 -4
- package/dist/core/modules/extras.module.js +3 -3
- package/dist/core/modules/playlist.module.js +4 -4
- package/dist/core/modules/song.module.d.ts +1 -1
- package/dist/core/modules/song.module.js +5 -5
- package/dist/helpers/experimental/stream-urls/index.js +13 -4
- package/dist/helpers/experimental/stream-urls/stream-urls.edge.js +1 -1
- package/dist/helpers/fetch.js +1 -1
- package/dist/helpers/utils.d.ts +1 -1
- package/dist/index.d.ts +11 -10
- package/dist/index.js +9 -8
- package/dist/saavn/common-mapper.d.ts +4 -4
- package/dist/saavn/entities/album.entity.js +2 -2
- package/dist/saavn/entities/artist.entity.js +2 -2
- package/dist/saavn/entities/extras.js +2 -2
- package/dist/saavn/entities/index.d.ts +6 -6
- package/dist/saavn/entities/index.js +6 -6
- package/dist/saavn/entities/playlist.entity.js +2 -2
- package/dist/saavn/entities/song.entity.js +1 -1
- package/dist/saavn/operations/get-details/index.d.ts +9 -9
- package/dist/saavn/operations/get-details/index.js +2 -2
- package/dist/saavn/operations/get-details/mapper.ops.d.ts +9 -9
- package/dist/saavn/operations/get-details/mapper.ops.js +2 -2
- package/dist/saavn/operations/get-details/schema.ops.js +3 -3
- package/dist/saavn/operations/get-reco/index.d.ts +4 -4
- package/dist/saavn/operations/get-reco/index.js +2 -2
- package/dist/saavn/operations/get-reco/mapper.ops.d.ts +4 -4
- package/dist/saavn/operations/get-reco/mapper.ops.js +2 -2
- package/dist/saavn/operations/get-reco/schema.ops.js +3 -3
- package/dist/saavn/operations/get-trending/index.d.ts +5 -5
- package/dist/saavn/operations/get-trending/index.js +2 -2
- package/dist/saavn/operations/get-trending/mapper.ops.d.ts +2 -2
- package/dist/saavn/operations/get-trending/mapper.ops.js +2 -2
- package/dist/saavn/operations/get-trending/schema.ops.js +2 -2
- package/dist/saavn/operations/index.d.ts +6 -6
- package/dist/saavn/operations/index.js +6 -6
- package/dist/saavn/operations/search-results/index.d.ts +39 -39
- package/dist/saavn/operations/search-results/index.js +2 -2
- package/dist/saavn/operations/search-results/mapper.ops.d.ts +39 -39
- package/dist/saavn/operations/search-results/mapper.ops.js +2 -2
- package/dist/saavn/operations/search-results/schema.ops.js +3 -3
- package/dist/saavn/operations/web-api/index.d.ts +5 -5
- package/dist/saavn/operations/web-api/index.js +2 -2
- package/dist/saavn/operations/web-api/mapper.ops.d.ts +5 -5
- package/dist/saavn/operations/web-api/mapper.ops.js +2 -2
- package/dist/saavn/operations/web-api/schema.ops.js +3 -3
- package/dist/saavn/operations/web-radio/index.d.ts +2 -2
- package/dist/saavn/operations/web-radio/index.js +2 -2
- package/dist/saavn/operations/web-radio/mapper.ops.d.ts +2 -2
- package/dist/saavn/operations/web-radio/mapper.ops.js +2 -2
- package/dist/saavn/operations/web-radio/schema.ops.js +3 -3
- package/dist/saavn/run-operation.js +2 -2
- package/dist/schemas/index.js +6 -6
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -7,6 +7,28 @@ A low-level, type-safe TypeScript SDK over **JioSaavn’s native API**, built fo
|
|
|
7
7
|
[](./LICENSE)
|
|
8
8
|
|
|
9
9
|
**This is not a product API. This is the foundation everything else is built on.**
|
|
10
|
+
|
|
11
|
+
## Table of contents
|
|
12
|
+
|
|
13
|
+
- [Why This Exists](#why-this-exists)
|
|
14
|
+
- [What This SDK Guarantees](#what-this-sdk-guarantees)
|
|
15
|
+
- [Design Principles](#design-principles)
|
|
16
|
+
- [Operations](#operations)
|
|
17
|
+
- [Installation](#installation)
|
|
18
|
+
- [Examples](#examples)
|
|
19
|
+
- [Get Songs by ID](#1-get-songs-by-id)
|
|
20
|
+
- [Get Song by Permalink](#2-get-song-by-permalink)
|
|
21
|
+
- [Search Songs](#3-search-songs)
|
|
22
|
+
- [Get Trending Albums](#4-get-trending-albums)
|
|
23
|
+
- [Cross-Entity Search](#5-cross-entity-search)
|
|
24
|
+
- [Full Module Documentation](#full-module-documentation)
|
|
25
|
+
- [Error Handling](#error-handling)
|
|
26
|
+
- [Runtime Support](#runtime-support)
|
|
27
|
+
- [What This SDK Does NOT Do](#what-this-sdk-does-not-do)
|
|
28
|
+
- [Development & Examples](#development--examples)
|
|
29
|
+
- [Contributing](#contributing)
|
|
30
|
+
- [Legal Notice](#legal-notice)
|
|
31
|
+
- [License](#license)
|
|
10
32
|
|
|
11
33
|
This SDK mirrors Saavn’s native operations at the boundary, while exposing stable, domain-level outputs to consumers.
|
|
12
34
|
|
|
@@ -70,30 +92,14 @@ This package is the **single source of truth** for interacting with JioSaavn’s
|
|
|
70
92
|
|
|
71
93
|
---
|
|
72
94
|
|
|
73
|
-
##
|
|
95
|
+
## Operations
|
|
74
96
|
|
|
75
|
-
|
|
76
|
-
@saavn-labs/sdk
|
|
77
|
-
├── saavn # ODD: Native Saavn operations, params, and raw response schemas
|
|
78
|
-
├── core # DDD: Stable SDK entities, primitives, and modules
|
|
79
|
-
├── mappers # Bridges from Saavn responses to domain entities
|
|
80
|
-
├── transport # Request lifecycle, fetch utilities, and user-agent rotation
|
|
81
|
-
└── types # Public TypeScript types and endpoint contracts
|
|
82
|
-
```
|
|
83
|
-
|
|
84
|
-
- **`saavn/` (Operations-Driven Design)** mirrors JioSaavn’s native calls (`call`, `params`, `response`) and stays close to upstream payloads.
|
|
85
|
-
- **`core/` (Domain-Driven Design)** is the long-lived surface for consumers; shapes change only in majors.
|
|
86
|
-
- **`mappers/`** connect raw Saavn responses to domain entities when normalization is needed.
|
|
87
|
-
- **`transport/`** provides the thin HTTP layer (`fetchFromSaavn`) with context selection, UA rotation, and timeouts.
|
|
88
|
-
|
|
89
|
-
### Operations currently modeled (0.x)
|
|
90
|
-
|
|
91
|
-
- `get-details` (song, album, artist, playlist, top albums of the year, top searches)
|
|
97
|
+
- `get-details` (album, artist, playlist, song, top albums of the year, top searches)
|
|
92
98
|
- `get-reco` (album, playlist, song)
|
|
93
99
|
- `get-trending` (all, albums, playlists, songs)
|
|
94
|
-
- `search-results`
|
|
95
|
-
- `web-api`
|
|
96
|
-
- `web-radio`
|
|
100
|
+
- `search-results` (all, albums, artists, playlists, songs)
|
|
101
|
+
- `web-api` (album, artist, playlist, songs)
|
|
102
|
+
- `web-radio` (ceate stations, get station songs)
|
|
97
103
|
|
|
98
104
|
Each operation ships Zod schemas for both parameters and raw responses, validated against recorded Postman fixtures in `tests/postman/collections`.
|
|
99
105
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from './album';
|
|
2
|
-
export * from './artist';
|
|
3
|
-
export * from './song';
|
|
4
|
-
export * from './playlist';
|
|
1
|
+
export * from './album.js';
|
|
2
|
+
export * from './artist.js';
|
|
3
|
+
export * from './song.js';
|
|
4
|
+
export * from './playlist.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from './album';
|
|
2
|
-
export * from './artist';
|
|
3
|
-
export * from './song';
|
|
4
|
-
export * from './playlist';
|
|
1
|
+
export * from './album.js';
|
|
2
|
+
export * from './artist.js';
|
|
3
|
+
export * from './song.js';
|
|
4
|
+
export * from './playlist.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { SaavnGetDetails, SaavnGetReco, SaavnGetTrending, SaavnSearchResults, SaavnWebAPI, } from '../../saavn/operations';
|
|
2
|
-
import { runOperation } from '../../saavn/run-operation';
|
|
3
|
-
import { extractPermalinkToken } from '../../helpers/utils';
|
|
4
|
-
import { SDKError } from '../../helpers/errors';
|
|
1
|
+
import { SaavnGetDetails, SaavnGetReco, SaavnGetTrending, SaavnSearchResults, SaavnWebAPI, } from '../../saavn/operations/index.js';
|
|
2
|
+
import { runOperation } from '../../saavn/run-operation.js';
|
|
3
|
+
import { extractPermalinkToken } from '../../helpers/utils.js';
|
|
4
|
+
import { SDKError } from '../../helpers/errors.js';
|
|
5
5
|
/**
|
|
6
6
|
* Fetch an album by Saavn ID.
|
|
7
7
|
*
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { SaavnGetDetails, SaavnSearchResults, SaavnWebAPI, } from '../../saavn/operations';
|
|
2
|
-
import { runOperation } from '../../saavn/run-operation';
|
|
3
|
-
import { extractPermalinkToken } from '../../helpers/utils';
|
|
4
|
-
import { SDKError } from '../../helpers/errors';
|
|
1
|
+
import { SaavnGetDetails, SaavnSearchResults, SaavnWebAPI, } from '../../saavn/operations/index.js';
|
|
2
|
+
import { runOperation } from '../../saavn/run-operation.js';
|
|
3
|
+
import { extractPermalinkToken } from '../../helpers/utils.js';
|
|
4
|
+
import { SDKError } from '../../helpers/errors.js';
|
|
5
5
|
/**
|
|
6
6
|
* Fetch an artist by Saavn ID.
|
|
7
7
|
*
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { SDKError } from '../../helpers/errors';
|
|
2
|
-
import { SaavnGetTrending, SaavnSearchResults, SaavnWebRadio, } from '../../saavn/operations';
|
|
3
|
-
import { runOperation } from '../../saavn/run-operation';
|
|
1
|
+
import { SDKError } from '../../helpers/errors.js';
|
|
2
|
+
import { SaavnGetTrending, SaavnSearchResults, SaavnWebRadio, } from '../../saavn/operations/index.js';
|
|
3
|
+
import { runOperation } from '../../saavn/run-operation.js';
|
|
4
4
|
export function stringArrayToJSONStringArray(value) {
|
|
5
5
|
if (!Array.isArray(value) || value.length === 0) {
|
|
6
6
|
throw new SDKError('INVALID_PARAMS', 'Expected a non-empty array of strings');
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { SaavnGetDetails, SaavnGetReco, SaavnGetTrending, SaavnSearchResults, SaavnWebAPI, } from '../../saavn/operations';
|
|
2
|
-
import { runOperation } from '../../saavn/run-operation';
|
|
3
|
-
import { extractPermalinkToken } from '../../helpers/utils';
|
|
4
|
-
import { SDKError } from '../../helpers/errors';
|
|
1
|
+
import { SaavnGetDetails, SaavnGetReco, SaavnGetTrending, SaavnSearchResults, SaavnWebAPI, } from '../../saavn/operations/index.js';
|
|
2
|
+
import { runOperation } from '../../saavn/run-operation.js';
|
|
3
|
+
import { extractPermalinkToken } from '../../helpers/utils.js';
|
|
4
|
+
import { SDKError } from '../../helpers/errors.js';
|
|
5
5
|
/**
|
|
6
6
|
* Fetch a playlist by Saavn ID.
|
|
7
7
|
*
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { SaavnGetDetails, SaavnGetReco, SaavnGetTrending, SaavnSearchResults, SaavnWebAPI, SaavnWebRadio, } from '../../saavn/operations';
|
|
2
|
-
import { runOperation } from '../../saavn/run-operation';
|
|
3
|
-
import { extractPermalinkToken } from '../../helpers/utils';
|
|
4
|
-
import { fetchStreamUrls } from '../../helpers/experimental/stream-urls';
|
|
5
|
-
import { SDKError } from '../../helpers/errors';
|
|
1
|
+
import { SaavnGetDetails, SaavnGetReco, SaavnGetTrending, SaavnSearchResults, SaavnWebAPI, SaavnWebRadio, } from '../../saavn/operations/index.js';
|
|
2
|
+
import { runOperation } from '../../saavn/run-operation.js';
|
|
3
|
+
import { extractPermalinkToken } from '../../helpers/utils.js';
|
|
4
|
+
import { fetchStreamUrls } from '../../helpers/experimental/stream-urls/index.js';
|
|
5
|
+
import { SDKError } from '../../helpers/errors.js';
|
|
6
6
|
/**
|
|
7
7
|
* Fetch a song or songs by Saavn ID.
|
|
8
8
|
*
|
|
@@ -1,6 +1,13 @@
|
|
|
1
|
-
import { SDKError, experimentalError } from '../../../helpers/errors';
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import { SDKError, experimentalError } from '../../../helpers/errors.js';
|
|
2
|
+
import { generateStreamUrlsEdge } from './stream-urls.edge.js';
|
|
3
|
+
async function loadNodeImpl() {
|
|
4
|
+
if (typeof process === 'undefined' ||
|
|
5
|
+
!process.versions?.node) {
|
|
6
|
+
throw new SDKError('UNSUPPORTED_RUNTIME', 'Node runtime required for node stream URL generation');
|
|
7
|
+
}
|
|
8
|
+
const mod = await import('./stream-urls.node.js');
|
|
9
|
+
return mod.generateStreamUrlsNode;
|
|
10
|
+
}
|
|
4
11
|
/**
|
|
5
12
|
* ⚠️ EXPERIMENTAL
|
|
6
13
|
*
|
|
@@ -23,8 +30,10 @@ export async function fetchStreamUrls(encryptedUrl, runtime, acknowledge) {
|
|
|
23
30
|
throw experimentalError('Stream URL generation is experimental and requires explicit acknowledgment.');
|
|
24
31
|
}
|
|
25
32
|
switch (runtime) {
|
|
26
|
-
case 'node':
|
|
33
|
+
case 'node': {
|
|
34
|
+
const generateStreamUrlsNode = await loadNodeImpl();
|
|
27
35
|
return generateStreamUrlsNode(encryptedUrl);
|
|
36
|
+
}
|
|
28
37
|
case 'edge':
|
|
29
38
|
return generateStreamUrlsEdge(encryptedUrl);
|
|
30
39
|
default:
|
package/dist/helpers/fetch.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* @module fetch
|
|
4
4
|
* @internal
|
|
5
5
|
*/
|
|
6
|
-
import { pickUserAgent } from './utils';
|
|
6
|
+
import { pickUserAgent } from './utils.js';
|
|
7
7
|
const BASE_URL = 'https://www.jiosaavn.com';
|
|
8
8
|
export const fetchFromSaavn = async ({ call, params = {}, context = 'web6dot0', baseUrl = BASE_URL, headers = {}, userAgents, timeoutMs, fetch: fetchImpl = globalThis.fetch, }) => {
|
|
9
9
|
const url = new URL(`${baseUrl}/api.php`);
|
package/dist/helpers/utils.d.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* @module utils
|
|
4
4
|
* @internal
|
|
5
5
|
*/
|
|
6
|
-
import type { SaavnPermalinkToken } from '../types';
|
|
6
|
+
import type { SaavnPermalinkToken } from '../types.js';
|
|
7
7
|
export declare function pickUserAgent(custom?: readonly string[]): string;
|
|
8
8
|
/**
|
|
9
9
|
* Extract entity type and token from a JioSaavn share URL
|
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
export { ArtistModule as Artist } from './core/modules/artist.module';
|
|
2
|
-
export { AlbumModule as Album } from './core/modules/album.module';
|
|
3
|
-
export { SongModule as Song } from './core/modules/song.module';
|
|
4
|
-
export { PlaylistModule as Playlist } from './core/modules/playlist.module';
|
|
5
|
-
export { ExtrasModule as Extras } from './core/modules/extras.module';
|
|
6
|
-
export { SDKError } from './helpers/errors';
|
|
7
|
-
export type { SDKErrorCode } from './helpers/errors';
|
|
8
|
-
export
|
|
9
|
-
export
|
|
10
|
-
export
|
|
1
|
+
export { ArtistModule as Artist } from './core/modules/artist.module.js';
|
|
2
|
+
export { AlbumModule as Album } from './core/modules/album.module.js';
|
|
3
|
+
export { SongModule as Song } from './core/modules/song.module.js';
|
|
4
|
+
export { PlaylistModule as Playlist } from './core/modules/playlist.module.js';
|
|
5
|
+
export { ExtrasModule as Extras } from './core/modules/extras.module.js';
|
|
6
|
+
export { SDKError } from './helpers/errors.js';
|
|
7
|
+
export type { SDKErrorCode } from './helpers/errors.js';
|
|
8
|
+
export { fetchFromSaavn } from "./helpers/fetch.js";
|
|
9
|
+
export * from './core/models/index.js';
|
|
10
|
+
export { schemas, type Schemas } from './schemas/index.js';
|
|
11
|
+
export type { EntityType, ClientConfig, Image, SaavnPermalinkToken, } from './types.js';
|
package/dist/index.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
export { ArtistModule as Artist } from './core/modules/artist.module';
|
|
2
|
-
export { AlbumModule as Album } from './core/modules/album.module';
|
|
3
|
-
export { SongModule as Song } from './core/modules/song.module';
|
|
4
|
-
export { PlaylistModule as Playlist } from './core/modules/playlist.module';
|
|
5
|
-
export { ExtrasModule as Extras } from './core/modules/extras.module';
|
|
6
|
-
export { SDKError } from './helpers/errors';
|
|
7
|
-
export
|
|
8
|
-
export
|
|
1
|
+
export { ArtistModule as Artist } from './core/modules/artist.module.js';
|
|
2
|
+
export { AlbumModule as Album } from './core/modules/album.module.js';
|
|
3
|
+
export { SongModule as Song } from './core/modules/song.module.js';
|
|
4
|
+
export { PlaylistModule as Playlist } from './core/modules/playlist.module.js';
|
|
5
|
+
export { ExtrasModule as Extras } from './core/modules/extras.module.js';
|
|
6
|
+
export { SDKError } from './helpers/errors.js';
|
|
7
|
+
export { fetchFromSaavn } from "./helpers/fetch.js";
|
|
8
|
+
export * from './core/models/index.js';
|
|
9
|
+
export { schemas } from './schemas/index.js';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import type { Image } from '../types';
|
|
2
|
+
import type { Image } from '../types.js';
|
|
3
3
|
import type { Album, Artist, Playlist, Song } from '../core/models';
|
|
4
|
-
import type { SaavnArtistBase } from '../saavn/entities/base';
|
|
5
|
-
import type { SaavnAlbumEntity, SaavnArtistEntity, SaavnPlaylistEntity, SaavnSongEntity } from '../saavn/entities';
|
|
6
|
-
import type { SaavnAlbumEdgeCase, SaavnPlaylistEdgeCase } from '../saavn/entities/extras';
|
|
4
|
+
import type { SaavnArtistBase } from '../saavn/entities/base.js';
|
|
5
|
+
import type { SaavnAlbumEntity, SaavnArtistEntity, SaavnPlaylistEntity, SaavnSongEntity } from '../saavn/entities/index.js';
|
|
6
|
+
import type { SaavnAlbumEdgeCase, SaavnPlaylistEdgeCase } from '../saavn/entities/extras.js';
|
|
7
7
|
export declare function parseImageUrls(imageUrl?: string): Image[];
|
|
8
8
|
export declare function mapArtistBase(artist: z.infer<typeof SaavnArtistBase>): Artist;
|
|
9
9
|
export declare function mapAlbumEdgeCase(data: z.infer<typeof SaavnAlbumEdgeCase>): Album;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { SaavnAlbumBase, SaavnArtistMap, SaavnTrendingBase } from './base';
|
|
3
|
-
import { SaavnSongEntity } from './song.entity';
|
|
2
|
+
import { SaavnAlbumBase, SaavnArtistMap, SaavnTrendingBase } from './base.js';
|
|
3
|
+
import { SaavnSongEntity } from './song.entity.js';
|
|
4
4
|
export const SaavnAlbumEntity = z.lazy(() => SaavnAlbumBase.extend({
|
|
5
5
|
language: z.string(),
|
|
6
6
|
year: z.string(),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { SaavnArtistBase } from './base';
|
|
3
|
-
import { SaavnAlbumEdgeCase, SaavnPlaylistEdgeCase, SaavnSongEntity } from '.';
|
|
2
|
+
import { SaavnArtistBase } from './base.js';
|
|
3
|
+
import { SaavnAlbumEdgeCase, SaavnPlaylistEdgeCase, SaavnSongEntity } from './index.js';
|
|
4
4
|
export const SaavnArtistEntity = z.lazy(() => SaavnArtistBase.omit({
|
|
5
5
|
id: true,
|
|
6
6
|
role: true,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { SaavnAlbumBase, SaavnAlbumCore, SaavnArtistBase, SaavnArtistMap, } from './base';
|
|
3
|
-
import { SaavnPlaylistSearchEntity } from './playlist.entity';
|
|
2
|
+
import { SaavnAlbumBase, SaavnAlbumCore, SaavnArtistBase, SaavnArtistMap, } from './base.js';
|
|
3
|
+
import { SaavnPlaylistSearchEntity } from './playlist.entity.js';
|
|
4
4
|
export const SaavnAlbumEdgeCase = SaavnAlbumBase.extend({
|
|
5
5
|
more_info: z.looseObject({
|
|
6
6
|
query: z.string(),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export * from './album.entity';
|
|
2
|
-
export * from './artist.entity';
|
|
3
|
-
export * from './playlist.entity';
|
|
4
|
-
export * from './song.entity';
|
|
5
|
-
export * from './show.entity';
|
|
6
|
-
export * from './extras';
|
|
1
|
+
export * from './album.entity.js';
|
|
2
|
+
export * from './artist.entity.js';
|
|
3
|
+
export * from './playlist.entity.js';
|
|
4
|
+
export * from './song.entity.js';
|
|
5
|
+
export * from './show.entity.js';
|
|
6
|
+
export * from './extras.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export * from './album.entity';
|
|
2
|
-
export * from './artist.entity';
|
|
3
|
-
export * from './playlist.entity';
|
|
4
|
-
export * from './song.entity';
|
|
5
|
-
export * from './show.entity';
|
|
6
|
-
export * from './extras';
|
|
1
|
+
export * from './album.entity.js';
|
|
2
|
+
export * from './artist.entity.js';
|
|
3
|
+
export * from './playlist.entity.js';
|
|
4
|
+
export * from './song.entity.js';
|
|
5
|
+
export * from './show.entity.js';
|
|
6
|
+
export * from './extras.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { SaavnArtistBase, SaavnPlaylistBase, SaavnTrendingBase } from './base';
|
|
3
|
-
import { SaavnSongEntity } from './song.entity';
|
|
2
|
+
import { SaavnArtistBase, SaavnPlaylistBase, SaavnTrendingBase } from './base.js';
|
|
3
|
+
import { SaavnSongEntity } from './song.entity.js';
|
|
4
4
|
export const SaavnPlaylistEntity = z.lazy(() => SaavnPlaylistBase.extend({
|
|
5
5
|
header_desc: z.string(),
|
|
6
6
|
language: z.string(),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { SaavnArtistMap, SaavnSongCore, SaavnSongBase, SaavnTrendingBase, } from './base';
|
|
2
|
+
import { SaavnArtistMap, SaavnSongCore, SaavnSongBase, SaavnTrendingBase, } from './base.js';
|
|
3
3
|
export const SaavnSongEntity = SaavnSongBase.extend({
|
|
4
4
|
more_info: z.looseObject({
|
|
5
5
|
music: z.string(),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SaavnGetDetailsSchema } from './schema.ops';
|
|
1
|
+
import { SaavnGetDetailsSchema } from './schema.ops.js';
|
|
2
2
|
export declare const SaavnGetDetails: {
|
|
3
3
|
readonly album: {
|
|
4
4
|
readonly call: "content.getAlbumDetails";
|
|
@@ -114,7 +114,7 @@ export declare const SaavnGetDetails: {
|
|
|
114
114
|
}, import("zod/v4/core").$loose>;
|
|
115
115
|
}, import("zod/v4/core").$loose>>;
|
|
116
116
|
};
|
|
117
|
-
readonly mapper: (data: import("zod").infer<typeof SaavnGetDetailsSchema.album.response>) => import("../../../core/models").Album;
|
|
117
|
+
readonly mapper: (data: import("zod").infer<typeof SaavnGetDetailsSchema.album.response>) => import("../../../core/models/album.js").Album;
|
|
118
118
|
};
|
|
119
119
|
readonly artist: {
|
|
120
120
|
readonly call: "artist.getArtistPageDetails";
|
|
@@ -397,7 +397,7 @@ export declare const SaavnGetDetails: {
|
|
|
397
397
|
}, import("zod/v4/core").$loose>;
|
|
398
398
|
}, import("zod/v4/core").$loose>>;
|
|
399
399
|
};
|
|
400
|
-
readonly mapper: (data: import("zod").infer<typeof SaavnGetDetailsSchema.artist.response>) => import("../../../core/models").Artist;
|
|
400
|
+
readonly mapper: (data: import("zod").infer<typeof SaavnGetDetailsSchema.artist.response>) => import("../../../core/models/artist.js").Artist;
|
|
401
401
|
};
|
|
402
402
|
readonly playlist: {
|
|
403
403
|
readonly call: "playlist.getDetails";
|
|
@@ -510,7 +510,7 @@ export declare const SaavnGetDetails: {
|
|
|
510
510
|
}, import("zod/v4/core").$loose>;
|
|
511
511
|
}, import("zod/v4/core").$loose>>;
|
|
512
512
|
};
|
|
513
|
-
readonly mapper: (data: import("zod").infer<typeof SaavnGetDetailsSchema.playlist.response>) => import("../../../core/models").Playlist;
|
|
513
|
+
readonly mapper: (data: import("zod").infer<typeof SaavnGetDetailsSchema.playlist.response>) => import("../../../core/models/playlist.js").Playlist;
|
|
514
514
|
};
|
|
515
515
|
readonly songs: {
|
|
516
516
|
readonly call: "song.getDetails";
|
|
@@ -582,7 +582,7 @@ export declare const SaavnGetDetails: {
|
|
|
582
582
|
}, import("zod/v4/core").$loose>;
|
|
583
583
|
};
|
|
584
584
|
readonly mapper: (data: import("zod").infer<typeof SaavnGetDetailsSchema.songs.response>) => {
|
|
585
|
-
songs: import("../../../core/models").Song[];
|
|
585
|
+
songs: import("../../../core/models/song.js").Song[];
|
|
586
586
|
};
|
|
587
587
|
};
|
|
588
588
|
readonly topAlbumsOfTheYear: {
|
|
@@ -700,7 +700,7 @@ export declare const SaavnGetDetails: {
|
|
|
700
700
|
}, import("zod/v4/core").$loose>;
|
|
701
701
|
}, import("zod/v4/core").$loose>>>;
|
|
702
702
|
};
|
|
703
|
-
readonly mapper: (data: import("zod").infer<typeof SaavnGetDetailsSchema.topAlbumsOfTheYear.response>) => import("../../../core/models").Album[];
|
|
703
|
+
readonly mapper: (data: import("zod").infer<typeof SaavnGetDetailsSchema.topAlbumsOfTheYear.response>) => import("../../../core/models/album.js").Album[];
|
|
704
704
|
};
|
|
705
705
|
readonly topSearches: {
|
|
706
706
|
readonly call: "content.getTopSearches";
|
|
@@ -732,7 +732,7 @@ export declare const SaavnGetDetails: {
|
|
|
732
732
|
title: string;
|
|
733
733
|
subtitle: string;
|
|
734
734
|
url: string;
|
|
735
|
-
images: import("
|
|
735
|
+
images: import("../../../types.js").Image[];
|
|
736
736
|
type: "album" | "artist" | "song";
|
|
737
737
|
} | {
|
|
738
738
|
type: "album";
|
|
@@ -741,7 +741,7 @@ export declare const SaavnGetDetails: {
|
|
|
741
741
|
title: string;
|
|
742
742
|
subtitle: string;
|
|
743
743
|
url: string;
|
|
744
|
-
images: import("
|
|
744
|
+
images: import("../../../types.js").Image[];
|
|
745
745
|
} | {
|
|
746
746
|
type: "song";
|
|
747
747
|
album: string;
|
|
@@ -749,7 +749,7 @@ export declare const SaavnGetDetails: {
|
|
|
749
749
|
title: string;
|
|
750
750
|
subtitle: string;
|
|
751
751
|
url: string;
|
|
752
|
-
images: import("
|
|
752
|
+
images: import("../../../types.js").Image[];
|
|
753
753
|
})[];
|
|
754
754
|
};
|
|
755
755
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { SaavnGetDetailsMapper } from './mapper.ops';
|
|
2
|
-
import { SaavnGetDetailsSchema } from './schema.ops';
|
|
1
|
+
import { SaavnGetDetailsMapper } from './mapper.ops.js';
|
|
2
|
+
import { SaavnGetDetailsSchema } from './schema.ops.js';
|
|
3
3
|
export const SaavnGetDetails = {
|
|
4
4
|
album: {
|
|
5
5
|
call: 'content.getAlbumDetails',
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { SaavnGetDetailsSchema } from './schema.ops';
|
|
2
|
+
import { SaavnGetDetailsSchema } from './schema.ops.js';
|
|
3
3
|
export declare const SaavnGetDetailsMapper: {
|
|
4
|
-
album: (data: z.infer<typeof SaavnGetDetailsSchema.album.response>) => import("../../../core/models").Album;
|
|
5
|
-
artist: (data: z.infer<typeof SaavnGetDetailsSchema.artist.response>) => import("../../../core/models").Artist;
|
|
6
|
-
playlist: (data: z.infer<typeof SaavnGetDetailsSchema.playlist.response>) => import("../../../core/models").Playlist;
|
|
4
|
+
album: (data: z.infer<typeof SaavnGetDetailsSchema.album.response>) => import("../../../core/models/album.js").Album;
|
|
5
|
+
artist: (data: z.infer<typeof SaavnGetDetailsSchema.artist.response>) => import("../../../core/models/artist.js").Artist;
|
|
6
|
+
playlist: (data: z.infer<typeof SaavnGetDetailsSchema.playlist.response>) => import("../../../core/models/playlist.js").Playlist;
|
|
7
7
|
songs: (data: z.infer<typeof SaavnGetDetailsSchema.songs.response>) => {
|
|
8
|
-
songs: import("../../../core/models").Song[];
|
|
8
|
+
songs: import("../../../core/models/song.js").Song[];
|
|
9
9
|
};
|
|
10
|
-
topAlbumsOfTheYear: (data: z.infer<typeof SaavnGetDetailsSchema.topAlbumsOfTheYear.response>) => import("../../../core/models").Album[];
|
|
10
|
+
topAlbumsOfTheYear: (data: z.infer<typeof SaavnGetDetailsSchema.topAlbumsOfTheYear.response>) => import("../../../core/models/album.js").Album[];
|
|
11
11
|
topSearches: (data: z.infer<typeof SaavnGetDetailsSchema.topSearches.response>) => ({
|
|
12
12
|
id: string;
|
|
13
13
|
title: string;
|
|
14
14
|
subtitle: string;
|
|
15
15
|
url: string;
|
|
16
|
-
images: import("
|
|
16
|
+
images: import("../../../types.js").Image[];
|
|
17
17
|
type: "album" | "artist" | "song";
|
|
18
18
|
} | {
|
|
19
19
|
type: "album";
|
|
@@ -22,7 +22,7 @@ export declare const SaavnGetDetailsMapper: {
|
|
|
22
22
|
title: string;
|
|
23
23
|
subtitle: string;
|
|
24
24
|
url: string;
|
|
25
|
-
images: import("
|
|
25
|
+
images: import("../../../types.js").Image[];
|
|
26
26
|
} | {
|
|
27
27
|
type: "song";
|
|
28
28
|
album: string;
|
|
@@ -30,6 +30,6 @@ export declare const SaavnGetDetailsMapper: {
|
|
|
30
30
|
title: string;
|
|
31
31
|
subtitle: string;
|
|
32
32
|
url: string;
|
|
33
|
-
images: import("
|
|
33
|
+
images: import("../../../types.js").Image[];
|
|
34
34
|
})[];
|
|
35
35
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { mapAlbum, mapArtist, mapPlaylist, mapSong, parseImageUrls, } from '../../common-mapper';
|
|
3
|
-
import { SaavnGetDetailsSchema } from './schema.ops';
|
|
2
|
+
import { mapAlbum, mapArtist, mapPlaylist, mapSong, parseImageUrls, } from '../../common-mapper.js';
|
|
3
|
+
import { SaavnGetDetailsSchema } from './schema.ops.js';
|
|
4
4
|
export const SaavnGetDetailsMapper = {
|
|
5
5
|
album: (data) => {
|
|
6
6
|
return mapAlbum(data);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
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';
|
|
2
|
+
import { SaavnAlbumEntity, SaavnArtistEntity, SaavnPlaylistEntity, SaavnSongEntity, SaavnTopSearchesEntity, } from '../../entities/index.js';
|
|
3
|
+
import { CSVString, NonEmptyString, PositiveString, } from '../../primitives/string.js';
|
|
4
|
+
import { SaavnSortBySchema, SaavnSortOrderSchema, } from '../../primitives/enums.js';
|
|
5
5
|
export const SaavnGetDetailsSchema = {
|
|
6
6
|
album: {
|
|
7
7
|
params: z.strictObject({
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SaavnGetRecoSchema } from './schema.ops';
|
|
1
|
+
import { SaavnGetRecoSchema } from './schema.ops.js';
|
|
2
2
|
export declare const SaavnGetReco: {
|
|
3
3
|
albums: {
|
|
4
4
|
call: string;
|
|
@@ -27,7 +27,7 @@ export declare const SaavnGetReco: {
|
|
|
27
27
|
subtitle: string;
|
|
28
28
|
description: string;
|
|
29
29
|
url: string;
|
|
30
|
-
images: import("
|
|
30
|
+
images: import("../../../types.js").Image[];
|
|
31
31
|
language: string;
|
|
32
32
|
year: number;
|
|
33
33
|
stats: {
|
|
@@ -63,7 +63,7 @@ export declare const SaavnGetReco: {
|
|
|
63
63
|
title: string;
|
|
64
64
|
subtitle: string;
|
|
65
65
|
url: string;
|
|
66
|
-
images: import("
|
|
66
|
+
images: import("../../../types.js").Image[];
|
|
67
67
|
flags: {
|
|
68
68
|
isExplicit: boolean;
|
|
69
69
|
};
|
|
@@ -139,6 +139,6 @@ export declare const SaavnGetReco: {
|
|
|
139
139
|
}, import("zod/v4/core").$loose>;
|
|
140
140
|
}, import("zod/v4/core").$loose>>>;
|
|
141
141
|
};
|
|
142
|
-
mapper: (data: import("zod").infer<typeof SaavnGetRecoSchema.songs.response>) => import("../../../core/models").Song[];
|
|
142
|
+
mapper: (data: import("zod").infer<typeof SaavnGetRecoSchema.songs.response>) => import("../../../core/models/song.js").Song[];
|
|
143
143
|
};
|
|
144
144
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { SaavnGetRecoMapper } from './mapper.ops';
|
|
2
|
-
import { SaavnGetRecoSchema } from './schema.ops';
|
|
1
|
+
import { SaavnGetRecoMapper } from './mapper.ops.js';
|
|
2
|
+
import { SaavnGetRecoSchema } from './schema.ops.js';
|
|
3
3
|
export const SaavnGetReco = {
|
|
4
4
|
albums: {
|
|
5
5
|
call: 'reco.getAlbumReco',
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { SaavnGetRecoSchema } from './schema.ops';
|
|
2
|
+
import { SaavnGetRecoSchema } from './schema.ops.js';
|
|
3
3
|
export declare const SaavnGetRecoMapper: {
|
|
4
4
|
albums: (data: z.infer<typeof SaavnGetRecoSchema.albums.response>) => {
|
|
5
5
|
id: string;
|
|
@@ -8,7 +8,7 @@ export declare const SaavnGetRecoMapper: {
|
|
|
8
8
|
subtitle: string;
|
|
9
9
|
description: string;
|
|
10
10
|
url: string;
|
|
11
|
-
images: import("
|
|
11
|
+
images: import("../../../types.js").Image[];
|
|
12
12
|
language: string;
|
|
13
13
|
year: number;
|
|
14
14
|
stats: {
|
|
@@ -24,7 +24,7 @@ export declare const SaavnGetRecoMapper: {
|
|
|
24
24
|
title: string;
|
|
25
25
|
subtitle: string;
|
|
26
26
|
url: string;
|
|
27
|
-
images: import("
|
|
27
|
+
images: import("../../../types.js").Image[];
|
|
28
28
|
flags: {
|
|
29
29
|
isExplicit: boolean;
|
|
30
30
|
};
|
|
@@ -32,5 +32,5 @@ export declare const SaavnGetRecoMapper: {
|
|
|
32
32
|
name: string;
|
|
33
33
|
};
|
|
34
34
|
}[];
|
|
35
|
-
songs: (data: z.infer<typeof SaavnGetRecoSchema.songs.response>) => import("../../../core/models").Song[];
|
|
35
|
+
songs: (data: z.infer<typeof SaavnGetRecoSchema.songs.response>) => import("../../../core/models/song.js").Song[];
|
|
36
36
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { mapSong, parseImageUrls, mapArtist } from '../../common-mapper';
|
|
3
|
-
import { SaavnGetRecoSchema } from './schema.ops';
|
|
2
|
+
import { mapSong, parseImageUrls, mapArtist } from '../../common-mapper.js';
|
|
3
|
+
import { SaavnGetRecoSchema } from './schema.ops.js';
|
|
4
4
|
export const SaavnGetRecoMapper = {
|
|
5
5
|
albums: (data) => {
|
|
6
6
|
return data.map((album) => ({
|