UNPKG

@kkboxorg/kkbox-javascript-developer-sdk

Version:

KKBOX Open API developer SDK for JavaScript. Use it to easily access KKBOX open API to get various metadata about KKBOX's tracks, albums, artists, playlists and stations.

1,596 lines (1,595 loc) 172 kB
{ "type": "File", "start": 0, "end": 1988, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 66, "column": 1 } }, "program": { "type": "Program", "start": 0, "end": 1988, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 66, "column": 1 } }, "sourceType": "module", "body": [ { "type": "ImportDeclaration", "start": 0, "end": 37, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 1, "column": 37 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 7, "end": 17, "loc": { "start": { "line": 1, "column": 7 }, "end": { "line": 1, "column": 17 } }, "local": { "type": "Identifier", "start": 7, "end": 17, "loc": { "start": { "line": 1, "column": 7 }, "end": { "line": 1, "column": 17 }, "identifierName": "HttpClient" }, "name": "HttpClient" } } ], "source": { "type": "StringLiteral", "start": 23, "end": 37, "loc": { "start": { "line": 1, "column": 23 }, "end": { "line": 1, "column": 37 } }, "extra": { "rawValue": "./HttpClient", "raw": "'./HttpClient'" }, "value": "./HttpClient" } }, { "type": "ImportDeclaration", "start": 38, "end": 81, "loc": { "start": { "line": 2, "column": 0 }, "end": { "line": 2, "column": 43 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 45, "end": 58, "loc": { "start": { "line": 2, "column": 7 }, "end": { "line": 2, "column": 20 } }, "local": { "type": "Identifier", "start": 45, "end": 58, "loc": { "start": { "line": 2, "column": 7 }, "end": { "line": 2, "column": 20 }, "identifierName": "SearchFetcher" }, "name": "SearchFetcher" } } ], "source": { "type": "StringLiteral", "start": 64, "end": 81, "loc": { "start": { "line": 2, "column": 26 }, "end": { "line": 2, "column": 43 } }, "extra": { "rawValue": "./SearchFetcher", "raw": "'./SearchFetcher'" }, "value": "./SearchFetcher" } }, { "type": "ImportDeclaration", "start": 82, "end": 123, "loc": { "start": { "line": 3, "column": 0 }, "end": { "line": 3, "column": 41 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 89, "end": 101, "loc": { "start": { "line": 3, "column": 7 }, "end": { "line": 3, "column": 19 } }, "local": { "type": "Identifier", "start": 89, "end": 101, "loc": { "start": { "line": 3, "column": 7 }, "end": { "line": 3, "column": 19 }, "identifierName": "TrackFetcher" }, "name": "TrackFetcher" } } ], "source": { "type": "StringLiteral", "start": 107, "end": 123, "loc": { "start": { "line": 3, "column": 25 }, "end": { "line": 3, "column": 41 } }, "extra": { "rawValue": "./TrackFetcher", "raw": "'./TrackFetcher'" }, "value": "./TrackFetcher" } }, { "type": "ImportDeclaration", "start": 124, "end": 165, "loc": { "start": { "line": 4, "column": 0 }, "end": { "line": 4, "column": 41 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 131, "end": 143, "loc": { "start": { "line": 4, "column": 7 }, "end": { "line": 4, "column": 19 } }, "local": { "type": "Identifier", "start": 131, "end": 143, "loc": { "start": { "line": 4, "column": 7 }, "end": { "line": 4, "column": 19 }, "identifierName": "AlbumFetcher" }, "name": "AlbumFetcher" } } ], "source": { "type": "StringLiteral", "start": 149, "end": 165, "loc": { "start": { "line": 4, "column": 25 }, "end": { "line": 4, "column": 41 } }, "extra": { "rawValue": "./AlbumFetcher", "raw": "'./AlbumFetcher'" }, "value": "./AlbumFetcher" } }, { "type": "ImportDeclaration", "start": 166, "end": 209, "loc": { "start": { "line": 5, "column": 0 }, "end": { "line": 5, "column": 43 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 173, "end": 186, "loc": { "start": { "line": 5, "column": 7 }, "end": { "line": 5, "column": 20 } }, "local": { "type": "Identifier", "start": 173, "end": 186, "loc": { "start": { "line": 5, "column": 7 }, "end": { "line": 5, "column": 20 }, "identifierName": "ArtistFetcher" }, "name": "ArtistFetcher" } } ], "source": { "type": "StringLiteral", "start": 192, "end": 209, "loc": { "start": { "line": 5, "column": 26 }, "end": { "line": 5, "column": 43 } }, "extra": { "rawValue": "./ArtistFetcher", "raw": "'./ArtistFetcher'" }, "value": "./ArtistFetcher" } }, { "type": "ImportDeclaration", "start": 210, "end": 273, "loc": { "start": { "line": 6, "column": 0 }, "end": { "line": 6, "column": 63 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 217, "end": 240, "loc": { "start": { "line": 6, "column": 7 }, "end": { "line": 6, "column": 30 } }, "local": { "type": "Identifier", "start": 217, "end": 240, "loc": { "start": { "line": 6, "column": 7 }, "end": { "line": 6, "column": 30 }, "identifierName": "FeaturedPlaylistFetcher" }, "name": "FeaturedPlaylistFetcher" } } ], "source": { "type": "StringLiteral", "start": 246, "end": 273, "loc": { "start": { "line": 6, "column": 36 }, "end": { "line": 6, "column": 63 } }, "extra": { "rawValue": "./FeaturedPlaylistFetcher", "raw": "'./FeaturedPlaylistFetcher'" }, "value": "./FeaturedPlaylistFetcher" } }, { "type": "ImportDeclaration", "start": 274, "end": 353, "loc": { "start": { "line": 7, "column": 0 }, "end": { "line": 7, "column": 79 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 281, "end": 312, "loc": { "start": { "line": 7, "column": 7 }, "end": { "line": 7, "column": 38 } }, "local": { "type": "Identifier", "start": 281, "end": 312, "loc": { "start": { "line": 7, "column": 7 }, "end": { "line": 7, "column": 38 }, "identifierName": "FeaturedPlaylistCategoryFetcher" }, "name": "FeaturedPlaylistCategoryFetcher" } } ], "source": { "type": "StringLiteral", "start": 318, "end": 353, "loc": { "start": { "line": 7, "column": 44 }, "end": { "line": 7, "column": 79 } }, "extra": { "rawValue": "./FeaturedPlaylistCategoryFetcher", "raw": "'./FeaturedPlaylistCategoryFetcher'" }, "value": "./FeaturedPlaylistCategoryFetcher" } }, { "type": "ImportDeclaration", "start": 354, "end": 409, "loc": { "start": { "line": 8, "column": 0 }, "end": { "line": 8, "column": 55 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 361, "end": 380, "loc": { "start": { "line": 8, "column": 7 }, "end": { "line": 8, "column": 26 } }, "local": { "type": "Identifier", "start": 361, "end": 380, "loc": { "start": { "line": 8, "column": 7 }, "end": { "line": 8, "column": 26 }, "identifierName": "GenreStationFetcher" }, "name": "GenreStationFetcher" } } ], "source": { "type": "StringLiteral", "start": 386, "end": 409, "loc": { "start": { "line": 8, "column": 32 }, "end": { "line": 8, "column": 55 } }, "extra": { "rawValue": "./GenreStationFetcher", "raw": "'./GenreStationFetcher'" }, "value": "./GenreStationFetcher" } }, { "type": "ImportDeclaration", "start": 410, "end": 463, "loc": { "start": { "line": 9, "column": 0 }, "end": { "line": 9, "column": 53 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 417, "end": 435, "loc": { "start": { "line": 9, "column": 7 }, "end": { "line": 9, "column": 25 } }, "local": { "type": "Identifier", "start": 417, "end": 435, "loc": { "start": { "line": 9, "column": 7 }, "end": { "line": 9, "column": 25 }, "identifierName": "MoodStationFetcher" }, "name": "MoodStationFetcher" } } ], "source": { "type": "StringLiteral", "start": 441, "end": 463, "loc": { "start": { "line": 9, "column": 31 }, "end": { "line": 9, "column": 53 } }, "extra": { "rawValue": "./MoodStationFetcher", "raw": "'./MoodStationFetcher'" }, "value": "./MoodStationFetcher", "leadingComments": null, "trailingComments": null }, "trailingComments": [ { "type": "CommentBlock", "value": "*\n * Fetch KKBOX resources.\n ", "start": 465, "end": 498, "loc": { "start": { "line": 11, "column": 0 }, "end": { "line": 13, "column": 3 } } } ] }, { "type": "ExportDefaultDeclaration", "start": 499, "end": 1988, "loc": { "start": { "line": 14, "column": 0 }, "end": { "line": 66, "column": 1 } }, "declaration": { "type": "ClassDeclaration", "start": 514, "end": 1988, "loc": { "start": { "line": 14, "column": 15 }, "end": { "line": 66, "column": 1 } }, "id": { "type": "Identifier", "start": 520, "end": 523, "loc": { "start": { "line": 14, "column": 21 }, "end": { "line": 14, "column": 24 }, "identifierName": "Api" }, "name": "Api", "leadingComments": null }, "superClass": null, "body": { "type": "ClassBody", "start": 524, "end": 1988, "loc": { "start": { "line": 14, "column": 25 }, "end": { "line": 66, "column": 1 } }, "body": [ { "type": "ClassMethod", "start": 812, "end": 1986, "loc": { "start": { "line": 23, "column": 4 }, "end": { "line": 65, "column": 5 } }, "computed": false, "key": { "type": "Identifier", "start": 812, "end": 823, "loc": { "start": { "line": 23, "column": 4 }, "end": { "line": 23, "column": 15 }, "identifierName": "constructor" }, "name": "constructor", "leadingComments": null }, "static": false, "kind": "constructor", "id": null, "generator": false, "expression": false, "async": false, "params": [ { "type": "Identifier", "start": 824, "end": 829, "loc": { "start": { "line": 23, "column": 16 }, "end": { "line": 23, "column": 21 }, "identifierName": "token" }, "name": "token" }, { "type": "AssignmentPattern", "start": 831, "end": 847, "loc": { "start": { "line": 23, "column": 23 }, "end": { "line": 23, "column": 39 } }, "left": { "type": "Identifier", "start": 831, "end": 840, "loc": { "start": { "line": 23, "column": 23 }, "end": { "line": 23, "column": 32 }, "identifierName": "territory" }, "name": "territory" }, "right": { "type": "StringLiteral", "start": 843, "end": 847, "loc": { "start": { "line": 23, "column": 35 }, "end": { "line": 23, "column": 39 } }, "extra": { "rawValue": "TW", "raw": "'TW'" }, "value": "TW" } } ], "body": { "type": "BlockStatement", "start": 849, "end": 1986, "loc": { "start": { "line": 23, "column": 41 }, "end": { "line": 65, "column": 5 } }, "body": [ { "type": "VariableDeclaration", "start": 859, "end": 893, "loc": { "start": { "line": 24, "column": 8 }, "end": { "line": 24, "column": 42 } }, "declarations": [ { "type": "VariableDeclarator", "start": 865, "end": 893, "loc": { "start": { "line": 24, "column": 14 }, "end": { "line": 24, "column": 42 } }, "id": { "type": "Identifier", "start": 865, "end": 869, "loc": { "start": { "line": 24, "column": 14 }, "end": { "line": 24, "column": 18 }, "identifierName": "http" }, "name": "http" }, "init": { "type": "NewExpression", "start": 872, "end": 893, "loc": { "start": { "line": 24, "column": 21 }, "end": { "line": 24, "column": 42 } }, "callee": { "type": "Identifier", "start": 876, "end": 886, "loc": { "start": { "line": 24, "column": 25 }, "end": { "line": 24, "column": 35 }, "identifierName": "HttpClient" }, "name": "HttpClient" }, "arguments": [ { "type": "Identifier", "start": 887, "end": 892, "loc": { "start": { "line": 24, "column": 36 }, "end": { "line": 24, "column": 41 }, "identifierName": "token" }, "name": "token" } ], "trailingComments": null }, "trailingComments": null } ], "kind": "const", "trailingComments": [ { "type": "CommentBlock", "value": "*\n * @type {SearchFetcher}\n ", "start": 903, "end": 951, "loc": { "start": { "line": 26, "column": 8 }, "end": { "line": 28, "column": 11 } } } ] }, { "type": "ExpressionStatement", "start": 960, "end": 1015, "loc": { "start": { "line": 29, "column": 8 }, "end": { "line": 29, "column": 63 } }, "expression": { "type": "AssignmentExpression", "start": 960, "end": 1015, "loc": { "start": { "line": 29, "column": 8 }, "end": { "line": 29, "column": 63 } }, "operator": "=", "left": { "type": "MemberExpression", "start": 960, "end": 978, "loc": { "start": { "line": 29, "column": 8 }, "end": { "line": 29, "column": 26 } }, "object": { "type": "ThisExpression", "start": 960, "end": 964, "loc": { "start": { "line": 29, "column": 8 }, "end": { "line": 29, "column": 12 } }, "leadingComments": null }, "property": { "type": "Identifier", "start": 965, "end": 978, "loc": { "start": { "line": 29, "column": 13 }, "end": { "line": 29, "column": 26 }, "identifierName": "searchFetcher" }, "name": "searchFetcher" }, "computed": false, "leadingComments": null }, "right": { "type": "NewExpression", "start": 981, "end": 1015, "loc": { "start": { "line": 29, "column": 29 }, "end": { "line": 29, "column": 63 } }, "callee": { "type": "Identifier", "start": 985, "end": 998, "loc": { "start": { "line": 29, "column": 33 }, "end": { "line": 29, "column": 46 }, "identifierName": "SearchFetcher" }, "name": "SearchFetcher" }, "arguments": [ { "type": "Identifier", "start": 999, "end": 1003, "loc": { "start": { "line": 29, "column": 47 }, "end": { "line": 29, "column": 51 }, "identifierName": "http" }, "name": "http" }, { "type": "Identifier", "start": 1005, "end": 1014, "loc": { "start": { "line": 29, "column": 53 }, "end": { "line": 29, "column": 62 }, "identifierName": "territory" }, "name": "territory" } ], "trailingComments": null }, "leadingComments": null, "trailingComments": null }, "leadingComments": [ { "type": "CommentBlock", "value": "*\n * @type {SearchFetcher}\n ", "start": 903, "end": 951, "loc": { "start": { "line": 26, "column": 8 }, "end": { "line": 28, "column": 11 } } } ], "trailingComments": [ { "type": "CommentBlock", "value": "*\n * @type {TrackFetcher}\n ", "start": 1025, "end": 1072, "loc": { "start": { "line": 31, "column": 8 }, "end": { "line": 33, "column": 11 } } } ] }, { "type": "ExpressionStatement", "start": 1081, "end": 1134, "loc": { "start": { "line": 34, "column": 8 }, "end": { "line": 34, "column": 61 } }, "expression": { "type": "AssignmentExpression", "start": 1081, "end": 1134, "loc": { "start": { "line": 34, "column": 8 }, "end": { "line": 34, "column": 61 } }, "operator": "=", "left": { "type": "MemberExpression", "start": 1081, "end": 1098, "loc": { "start": { "line": 34, "column": 8 }, "end": { "line": 34, "column": 25 } }, "object": { "type": "ThisExpression", "start": 1081, "end": 1085, "loc": { "start": { "line": 34, "column": 8 }, "end": { "line": 34, "column": 12 } }, "leadingComments": null }, "property": { "type": "Identifier", "start": 1086, "end": 1098, "loc": { "start": { "line": 34, "column": 13 }, "end": { "line": 34, "column": 25 }, "identifierName": "trackFetcher" }, "name": "trackFetcher" }, "computed": false, "leadingComments": null }, "right": { "type": "NewExpression", "start": 1101, "end": 1134, "loc": { "start": { "line": 34, "column": 28 }, "end": { "line": 34, "column": 61 } }, "callee": { "type": "Identifier", "start": 1105, "end": 1117, "loc": { "start": { "line": 34, "column": 32 }, "end": { "line": 34, "column": 44 }, "identifierName": "TrackFetcher" }, "name": "TrackFetcher" }, "arguments": [ { "type": "Identifier", "start": 1118, "end": 1122, "loc": { "start": { "line": 34, "column": 45 }, "end": { "line": 34, "column": 49 }, "identifierName": "http" }, "name": "http" }, { "type": "Identifier", "start": 1124, "end": 1133, "loc": { "start": { "line": 34, "column": 51 }, "end": { "line": 34, "column": 60 }, "identifierName": "territory" }, "name": "territory" } ], "trailingComments": null }, "leadingComments": null, "trailingComments": null }, "leadingComments": [ { "type": "CommentBlock", "value": "*\n * @type {TrackFetcher}\n ", "start": 1025, "end": 1072, "loc": { "start": { "line": 31, "column": 8 }, "end": { "line": 33, "column": 11 } } } ], "trailingComments": [ { "type": "CommentBlock", "value": "*\n * @type {AlbumFetcher}\n ", "start": 1144, "end": 1191, "loc": { "start": { "line": 36, "column": 8 }, "end": { "line": 38, "column": 11 } } } ] }, { "type": "ExpressionStatement", "start": 1200, "end": 1253, "loc": { "start": { "line": 39, "column": 8 }, "end": { "line": 39, "column": 61 } }, "expression": { "type": "AssignmentExpression", "start": 1200, "end": 1253, "loc": { "start": { "line": 39, "column": 8 }, "end": { "line": 39, "column": 61 } }, "operator": "=", "left": { "type": "MemberExpression", "start": 1200, "end": 1217, "loc": { "start": { "line": 39, "column": 8 }, "end": { "line": 39, "column": 25 } }, "object": { "type": "ThisExpression", "start": 1200, "end": 1204, "loc": { "start": { "line": 39, "column": 8 }, "end": { "line": 39, "column": 12 } }, "leadingComments": null }, "property": { "type": "Identifier", "start": 1205, "end": 1217, "loc": { "start": { "line": 39, "column": 13 }, "end": { "line": 39, "column": 25 }, "identifierName": "albumFetcher" }, "name": "albumFetcher" }, "computed": false, "leadingComments": null }, "right": { "type": "NewExpression", "start": 1220, "end": 1253, "loc": { "start": { "line": 39, "column": 28 }, "end": { "line": 39, "column": 61 } }, "callee": { "type": "Identifier", "start": 1224, "end": 1236, "loc": { "start": { "line": 39, "column": 32 }, "end": { "line": 39, "column": 44 }, "identifierName": "AlbumFetcher" }, "name": "AlbumFetcher" }, "arguments": [ { "type": "Identifier", "start": 1237, "end": 1241, "loc": { "start": { "line": 39, "column": 45 }, "end": { "line": 39, "column": 49 }, "identifierName": "http" }, "name": "http" }, { "type": "Identifier", "start": 1243, "end": 1252, "loc": { "start": { "line": 39, "column": 51 }, "end": { "line": 39, "column": 60 }, "identifierName": "territory" }, "name": "territory" } ], "trailingComments": null }, "leadingComments": null, "trailingComments": null }, "leadingComments": [ { "type": "CommentBlock", "value": "*\n * @type {AlbumFetcher}\n ", "start": 1144, "end": 1191, "loc": { "start": { "line": 36, "column": 8 }, "end": { "line": 38, "column": 11 } } } ], "trailingComments": [ { "type": "CommentBlock", "value": "*\n * @type {ArtistFetcher}\n ", "start": 1263, "end": 1311, "loc": { "start": { "line": 41, "column": 8 }, "end": { "line": 43, "column": 11 } } } ] }, { "type": "ExpressionStatement", "start": 1320, "end": 1375, "loc": { "start": { "line": 44, "column": 8 }, "end": { "line": 44, "column": 63 } }, "expression": { "type": "AssignmentExpression", "start": 1320, "end": 1375, "loc": { "start": { "line": 44, "column": 8 }, "end": { "line": 44, "column": 63 } }, "operator": "=", "left": { "type": "MemberExpression", "start": 1320, "end": 1338, "loc": { "start": { "line": 44, "column": 8 }, "end": { "line": 44, "column": 26 } }, "object": { "type": "ThisExpression", "start": 1320, "end": 1324, "loc": { "start": { "line": 44, "column": 8 },