@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,14 @@
|
|
|
1
|
+
import { SaavnGetDetailsSchema } from '../saavn/operations/get-details/schema.ops';
|
|
2
|
+
import { SaavnGetRecoSchema } from '../saavn/operations/get-reco/schema.ops';
|
|
3
|
+
import { SaavnGetTrendingSchema } from '../saavn/operations/get-trending/schema.ops';
|
|
4
|
+
import { SaavnSearchResultsSchema } from '../saavn/operations/search-results/schema.ops';
|
|
5
|
+
import { SaavnWebAPISchema } from '../saavn/operations/web-api/schema.ops';
|
|
6
|
+
import { SaavnWebRadioSchema } from '../saavn/operations/web-radio/schema.ops';
|
|
7
|
+
export const schemas = {
|
|
8
|
+
details: SaavnGetDetailsSchema,
|
|
9
|
+
recommendations: SaavnGetRecoSchema,
|
|
10
|
+
trending: SaavnGetTrendingSchema,
|
|
11
|
+
search: SaavnSearchResultsSchema,
|
|
12
|
+
webApi: SaavnWebAPISchema,
|
|
13
|
+
webRadio: SaavnWebRadioSchema,
|
|
14
|
+
};
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export type EntityType = 'album' | 'artist' | 'label' | 'playlist' | 'show' | 'song';
|
|
3
|
+
export interface ClientConfig {
|
|
4
|
+
baseUrl: string;
|
|
5
|
+
fetch?: typeof fetch;
|
|
6
|
+
timeoutMs?: number;
|
|
7
|
+
}
|
|
8
|
+
type ImageResolution = '50x50' | '150x150' | '500x500';
|
|
9
|
+
export type Image = {
|
|
10
|
+
url: string;
|
|
11
|
+
resolution: ImageResolution;
|
|
12
|
+
};
|
|
13
|
+
export type SaavnOperation = {
|
|
14
|
+
call: string;
|
|
15
|
+
schema: {
|
|
16
|
+
params: z.ZodType;
|
|
17
|
+
response: z.ZodType;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
export interface SaavnPermalinkToken {
|
|
21
|
+
type: EntityType;
|
|
22
|
+
token: string;
|
|
23
|
+
}
|
|
24
|
+
export {};
|
package/dist/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import { z } from 'zod';
|
package/package.json
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@saavn-labs/sdk",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "A low-level, type-safe TypeScript SDK over JioSaavn’s native API, built for developers who want full control, predictable contracts, and long-term stability.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"import": "./dist/index.js",
|
|
11
|
+
"types": "./dist/index.d.ts"
|
|
12
|
+
},
|
|
13
|
+
"./*": null
|
|
14
|
+
},
|
|
15
|
+
"typesVersions": {
|
|
16
|
+
"*": {
|
|
17
|
+
"*": [
|
|
18
|
+
"dist/index.d.ts"
|
|
19
|
+
]
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"files": [
|
|
23
|
+
"dist",
|
|
24
|
+
"README.md",
|
|
25
|
+
"LICENSE"
|
|
26
|
+
],
|
|
27
|
+
"scripts": {
|
|
28
|
+
"build": "tsc -p tsconfig.build.json && tsc-alias -p tsconfig.build.json",
|
|
29
|
+
"test": "vitest",
|
|
30
|
+
"test:run": "vitest run",
|
|
31
|
+
"examples:api": "bun examples/api/server.ts",
|
|
32
|
+
"prettier": "prettier --write ."
|
|
33
|
+
},
|
|
34
|
+
"keywords": [
|
|
35
|
+
"saavn-labs",
|
|
36
|
+
"jiosaavn",
|
|
37
|
+
"saavn",
|
|
38
|
+
"music",
|
|
39
|
+
"api",
|
|
40
|
+
"sdk",
|
|
41
|
+
"typescript",
|
|
42
|
+
"cloudflare-workers",
|
|
43
|
+
"vercel-serverless",
|
|
44
|
+
"vercel-edge",
|
|
45
|
+
"bun",
|
|
46
|
+
"deno",
|
|
47
|
+
"streaming",
|
|
48
|
+
"download",
|
|
49
|
+
"songs",
|
|
50
|
+
"albums",
|
|
51
|
+
"artists",
|
|
52
|
+
"playlists",
|
|
53
|
+
"trending"
|
|
54
|
+
],
|
|
55
|
+
"author": "Saavn Labs <saavnlabs@gmail.com>",
|
|
56
|
+
"license": "MIT",
|
|
57
|
+
"repository": {
|
|
58
|
+
"type": "git",
|
|
59
|
+
"url": "https://github.com/saavn-labs/sdk.git"
|
|
60
|
+
},
|
|
61
|
+
"publishConfig": {
|
|
62
|
+
"access": "public"
|
|
63
|
+
},
|
|
64
|
+
"bugs": {
|
|
65
|
+
"url": "https://github.com/saavn-labs/sdk/issues"
|
|
66
|
+
},
|
|
67
|
+
"homepage": "https://github.com/saavn-labs/sdk#readme",
|
|
68
|
+
"dependencies": {
|
|
69
|
+
"zod": "^4.2.1"
|
|
70
|
+
},
|
|
71
|
+
"devDependencies": {
|
|
72
|
+
"@types/bun": "latest",
|
|
73
|
+
"prettier": "^3.7.4",
|
|
74
|
+
"tsc-alias": "^1.8.16",
|
|
75
|
+
"typescript": "^5.9.3",
|
|
76
|
+
"vite-tsconfig-paths": "^6.0.3",
|
|
77
|
+
"vitest": "^4.0.16"
|
|
78
|
+
},
|
|
79
|
+
"engines": {
|
|
80
|
+
"node": ">=18"
|
|
81
|
+
}
|
|
82
|
+
}
|