@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,408 lines • 1.11 MB
JSON
{
"type": "File",
"start": 0,
"end": 6909,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 165,
"column": 1
}
},
"program": {
"type": "Program",
"start": 0,
"end": 6909,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 165,
"column": 1
}
},
"sourceType": "module",
"body": [
{
"type": "ImportDeclaration",
"start": 0,
"end": 46,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 46
}
},
"specifiers": [
{
"type": "ImportSpecifier",
"start": 8,
"end": 26,
"loc": {
"start": {
"line": 1,
"column": 8
},
"end": {
"line": 1,
"column": 26
}
},
"imported": {
"type": "Identifier",
"start": 8,
"end": 14,
"loc": {
"start": {
"line": 1,
"column": 8
},
"end": {
"line": 1,
"column": 14
},
"identifierName": "SEARCH"
},
"name": "SEARCH"
},
"local": {
"type": "Identifier",
"start": 18,
"end": 26,
"loc": {
"start": {
"line": 1,
"column": 18
},
"end": {
"line": 1,
"column": 26
},
"identifierName": "ENDPOINT"
},
"name": "ENDPOINT"
}
}
],
"source": {
"type": "StringLiteral",
"start": 33,
"end": 46,
"loc": {
"start": {
"line": 1,
"column": 33
},
"end": {
"line": 1,
"column": 46
}
},
"extra": {
"rawValue": "../Endpoint",
"raw": "'../Endpoint'"
},
"value": "../Endpoint"
}
},
{
"type": "ImportDeclaration",
"start": 47,
"end": 78,
"loc": {
"start": {
"line": 2,
"column": 0
},
"end": {
"line": 2,
"column": 31
}
},
"specifiers": [
{
"type": "ImportDefaultSpecifier",
"start": 54,
"end": 61,
"loc": {
"start": {
"line": 2,
"column": 7
},
"end": {
"line": 2,
"column": 14
}
},
"local": {
"type": "Identifier",
"start": 54,
"end": 61,
"loc": {
"start": {
"line": 2,
"column": 7
},
"end": {
"line": 2,
"column": 14
},
"identifierName": "Fetcher"
},
"name": "Fetcher"
}
}
],
"source": {
"type": "StringLiteral",
"start": 67,
"end": 78,
"loc": {
"start": {
"line": 2,
"column": 20
},
"end": {
"line": 2,
"column": 31
}
},
"extra": {
"rawValue": "./Fetcher",
"raw": "'./Fetcher'"
},
"value": "./Fetcher",
"leadingComments": null,
"trailingComments": null
},
"trailingComments": [
{
"type": "CommentBlock",
"value": "*\n * Search API.\n * @see https://docs.kkbox.codes/docs/search\n ",
"start": 80,
"end": 147,
"loc": {
"start": {
"line": 4,
"column": 0
},
"end": {
"line": 7,
"column": 3
}
}
}
]
},
{
"type": "ExportDefaultDeclaration",
"start": 148,
"end": 2536,
"loc": {
"start": {
"line": 8,
"column": 0
},
"end": {
"line": 85,
"column": 1
}
},
"declaration": {
"type": "ClassDeclaration",
"start": 163,
"end": 2536,
"loc": {
"start": {
"line": 8,
"column": 15
},
"end": {
"line": 85,
"column": 1
}
},
"id": {
"type": "Identifier",
"start": 169,
"end": 182,
"loc": {
"start": {
"line": 8,
"column": 21
},
"end": {
"line": 8,
"column": 34
},
"identifierName": "SearchFetcher"
},
"name": "SearchFetcher",
"leadingComments": null
},
"superClass": {
"type": "Identifier",
"start": 191,
"end": 198,
"loc": {
"start": {
"line": 8,
"column": 43
},
"end": {
"line": 8,
"column": 50
},
"identifierName": "Fetcher"
},
"name": "Fetcher"
},
"body": {
"type": "ClassBody",
"start": 199,
"end": 2536,
"loc": {
"start": {
"line": 8,
"column": 51
},
"end": {
"line": 85,
"column": 1
}
},
"body": [
{
"type": "ClassMethod",
"start": 236,
"end": 541,
"loc": {
"start": {
"line": 12,
"column": 4
},
"end": {
"line": 29,
"column": 5
}
},
"computed": false,
"key": {
"type": "Identifier",
"start": 236,
"end": 247,
"loc": {
"start": {
"line": 12,
"column": 4
},
"end": {
"line": 12,
"column": 15
},
"identifierName": "constructor"
},
"name": "constructor",
"leadingComments": null
},
"static": false,
"kind": "constructor",
"id": null,
"generator": false,
"expression": false,
"async": false,
"params": [
{
"type": "Identifier",
"start": 248,
"end": 252,
"loc": {
"start": {
"line": 12,
"column": 16
},
"end": {
"line": 12,
"column": 20
},
"identifierName": "http"
},
"name": "http"
},
{
"type": "AssignmentPattern",
"start": 254,
"end": 270,
"loc": {
"start": {
"line": 12,
"column": 22
},
"end": {
"line": 12,
"column": 38
}
},
"left": {
"type": "Identifier",
"start": 254,
"end": 263,
"loc": {
"start": {
"line": 12,
"column": 22
},
"end": {
"line": 12,
"column": 31
},
"identifierName": "territory"
},
"name": "territory"
},
"right": {
"type": "StringLiteral",
"start": 266,
"end": 270,
"loc": {
"start": {
"line": 12,
"column": 34
},
"end": {
"line": 12,
"column": 38
}
},
"extra": {
"rawValue": "TW",
"raw": "'TW'"
},
"value": "TW"
}
}
],
"body": {
"type": "BlockStatement",
"start": 272,
"end": 541,
"loc": {
"start": {
"line": 12,
"column": 40
},
"end": {
"line": 29,
"column": 5
}
},
"body": [
{
"type": "ExpressionStatement",
"start": 282,
"end": 304,
"loc": {
"start": {
"line": 13,
"column": 8
},
"end": {
"line": 13,
"column": 30
}
},
"expression": {
"type": "CallExpression",
"start": 282,
"end": 304,
"loc": {
"start": {
"line": 13,
"column": 8
},
"end": {
"line": 13,
"column": 30
}
},
"callee": {
"type": "Super",
"start": 282,
"end": 287,
"loc": {
"start": {
"line": 13,
"column": 8
},
"end": {
"line": 13,
"column": 13
}
}
},
"arguments": [
{
"type": "Identifier",
"start": 288,
"end": 292,
"loc": {
"start": {
"line": 13,
"column": 14
},
"end": {
"line": 13,
"column": 18
},
"identifierName": "http"
},
"name": "http"
},
{
"type": "Identifier",
"start": 294,
"end": 303,
"loc": {
"start": {
"line": 13,
"column": 20
},
"end": {
"line": 13,
"column": 29
},
"identifierName": "territory"
},
"name": "territory"
}
],
"trailingComments": null
},
"trailingComments": [
{
"type": "CommentBlock",
"value": "*\n * @ignore\n ",
"start": 314,
"end": 348,
"loc": {
"start": {
"line": 15,
"column": 8
},
"end": {
"line": 17,
"column": 11
}
}
}
]
},
{
"type": "ExpressionStatement",
"start": 357,
"end": 390,
"loc": {
"start": {
"line": 18,
"column": 8
},
"end": {
"line": 18,
"column": 41
}
},
"expression": {
"type": "AssignmentExpression",
"start": 357,
"end": 390,
"loc": {
"start": {
"line": 18,
"column": 8
},
"end": {
"line": 18,
"column": 41
}
},
"operator": "=",
"left": {
"type": "MemberExpression",
"start": 357,
"end": 378,
"loc": {
"start": {
"line": 18,
"column": 8
},
"end": {
"line": 18,
"column": 29
}
},
"object": {
"type": "ThisExpression",
"start": 357,
"end": 361,
"loc": {
"start": {
"line": 18,
"column": 8
},
"end": {
"line": 18,
"column": 12
}
},
"leadingComments": null
},
"property": {
"type": "Identifier",
"start": 362,
"end": 378,
"loc": {
"start": {
"line": 18,
"column": 13
},
"end": {
"line": 18,
"column": 29
},
"identifierName": "filterConditions"
},
"name": "filterConditions"
},
"computed": false,
"leadingComments": null
},
"right": {
"type": "Identifier",
"start": 381,
"end": 390,
"loc": {
"start": {
"line": 18,
"column": 32
},
"end": {
"line": 18,
"column": 41
},
"identifierName": "undefined"
},
"name": "undefined",
"leadingComments": null,
"trailingComments": null
},
"leadingComments": null,
"trailingComments": null
},
"leadingComments": [
{
"type": "CommentBlock",
"value": "*\n * @ignore\n ",
"start": 314,
"end": 348,
"loc": {
"start": {
"line": 15,
"column": 8
},
"end": {
"line": 17,
"column": 11
}
}
}
],
"trailingComments": [
{
"type": "CommentBlock",
"value": "*\n * @ignore\n ",
"start": 400,
"end": 434,
"loc": {
"start": {
"line": 20,
"column": 8
},
"end": {
"line": 22,
"column": 11
}
}
}
]
},
{
"type": "ExpressionStatement",
"start": 443,
"end": 461,
"loc": {
"start": {
"line": 23,
"column": 8
},
"end": {
"line": 23,
"column": 26
}
},
"expression": {
"type": "AssignmentExpression",
"start": 443,
"end": 461,
"loc": {
"start": {
"line": 23,
"column": 8
},
"end": {
"line": 23,
"column": 26
}
},
"operator": "=",
"left": {
"type": "MemberExpression",
"start": 443,
"end": 449,
"loc": {
"start": {
"line": 23,
"column": 8
},
"end": {
"line": 23,
"column": 14
}
},
"object": {
"type": "ThisExpression",
"start": 443,
"end": 447,
"loc": {
"start": {
"line": 23,
"column": 8
},
"end": {
"line": 23,
"column": 12
}
},
"leadingComments": null
},
"property": {
"type": "Identifier",
"start": 448,
"end": 449,
"loc": {
"start": {
"line": 23,
"column": 13
},
"end": {
"line": 23,
"column": 14
},
"identifierName": "q"
},
"name": "q"
},
"computed": false,
"leadingComments": null
},
"right": {
"type": "Identifier",
"start": 452,
"end": 461,
"loc": {
"start": {
"line": 23,
"column": 17
},
"end": {
"line": 23,
"column": 26
},
"identifierName": "undefined"
},
"name": "undefined",
"leadingComments": null,
"trailingComments": null
},
"leadingComments": null,
"trailingComments": null
},
"leadingComments": [
{
"type": "CommentBlock",
"value": "*\n * @ignore\n ",
"start": 400,
"end": 434,
"loc": {
"start": {
"line": 20,
"column": 8
},
"end": {
"line": 22,
"column": 11
}
}
}
],
"trailingComments": [
{
"type": "CommentBlock",
"value": "*\n * @ignore\n ",
"start": 471,
"end": 505,
"loc": {
"start": {
"line": 25,
"column": 8
},
"end": {
"line": 27,
"column": 11
}
}
}
]
},
{
"type": "ExpressionStatement",
"start": 514,
"end": 535,
"loc": {
"start": {
"line": 28,
"column": 8
},
"end": {
"line": 28,
"column": 29
}
},
"expression": {
"type": "AssignmentExpression",
"start": 514,
"end": 535,
"loc": {
"start": {
"line": 28,
"column": 8
},
"end": {
"line": 28,
"column": 29
}
},
"operator": "=",
"left": {
"type": "MemberExpression",
"start": 514,
"end": 523,
"loc": {
"start": {
"line": 28,
"column": 8
},
"end": {
"line": 28,
"column": 17
}
},
"object": {
"type": "ThisExpression",
"start": 514,
"end": 518,
"loc": {
"start": {
"line": 28,
"column": 8
},
"end": {
"line": 28,
"column": 12
}
},
"leadingComments": null
},
"property": {
"type": "Identifier",
"start": 519,
"end": 523,
"loc": {
"start": {
"line": 28,
"column": 13
},
"end": {
"line": 28,
"column": 17
},
"identifierName": "type"
},
"name": "type"
},
"computed": false,
"leadingComments": null
},
"right": {
"type": "Identifier",
"start": 526,
"end": 535,
"loc": {
"start": {
"line": 28,
"column": 20
},
"end": {
"line": 28,
"column": 29
},
"identifierName": "undefined"
},
"name": "undefined"
},
"leadingComments": null
},
"leadingComments": [
{
"type": "CommentBlock",
"value": "*\n * @ignore\n ",
"start": 471,
"end": 505,
"loc": {
"start": {
"line": 25,
"column": 8
},
"end": {
"line": 27,
"column": 11
}
}
}
]
}
],
"directives": [],
"trailingComments": null
},
"leadingComments": [
{
"type": "CommentBlock",
"value": "*\n * @ignore\n ",
"start": 205,
"end": 231,
"loc": {
"start": {
"line": 9,
"column": 4
},
"end": {
"line": 11,
"column": 7
}
}
}
],
"trailingComments": [
{
"type": "CommentBlock",
"value": "*\n * Filter what you don't want when search.\n *\n * @param {Object} [conditions] - search conditions.\n * @param {string} conditions.track - track's name.\n * @param {string} conditions.album - album's name.\n * @param {string} conditions.artist - artist's name.\n * @param {string} conditions.playlist - playlist's title.\n * @param {string} conditions.available_territory - tracks and albums available territory.\n * @return {Search}\n * @example api.searchFetcher.setSearchCriteria('五月天 好好').filter({artist: '五月天'}).fetchSearchResult()\n ",
"start": 547,
"end": 1127,
"loc": {
"start": {
"line": 31,
"column": 4
},
"end": {
"line": 42,
"column": 7
}
}
}
]
},
{
"type": "ClassMethod",
"start": 1132,
"end": 1388,
"loc": {
"start": {
"line": 43,
"column": 4
},
"end": {
"line": 52,
"column": 5
}
},
"computed": false,
"key": {
"type": "Identifier",
"start": 1132,
"end": 1138,
"loc": {
"start": {
"line": 43,
"column": 4
},
"end": {
"line": 43,
"column": 10
},
"identifierName": "filter"
},
"name": "filter",
"leadingComments": null
},
"static": false,
"kind": "method",
"id": null,
"generator": false,
"expression": false,
"async": false,
"params": [
{
"type": "AssignmentPattern",
"start": 1139,
"end": 1316,
"loc": {
"start": {
"line": 43,
"column": 11
},
"end": {
"line": 49,
"column": 10
}
},
"left": {
"type": "Identifier",
"start": 1139,
"end": 1149,
"loc": {
"start": {
"line": 43,
"column": 11
},
"end": {
"line": 43,
"column": 21
},
"identifierName": "conditions"
},
"name": "conditions"
},
"right": {
"type": "AssignmentExpression",
"start": 1152,
"end": 1316,
"loc": {
"start": {
"line": 43,
"column": 24
},
"end": {
"line": 49,
"column": 10
}
},
"operator": "=",
"left": {
"type": "ObjectPattern",
"start": 1152,
"end": 1311,
"loc": {
"start": {
"line": 43,
"column": 24
},
"end": {
"line": 49,
"column": 5
}
},
"properties": [
{
"type": "ObjectProperty",
"start": 1162,
"end": 1179,
"loc": {
"start": {
"line": 44,
"column": 8
},
"end": {
"line": 44,
"column": 25
}
},
"method": false,
"shorthand": true,
"computed": false,
"key": {
"type": "Identifier",
"start": 1162,
"end": 1167,
"loc": {
"start": {
"line": 44,
"column": 8
},
"end": {
"line": 44,
"column": 13
},
"identifierName": "track"
},
"name": "track"
},
"value": {
"type": "AssignmentPattern",
"start": 1162,
"end": 1179,
"loc": {
"start": {
"line": 44,
"column": 8
},
"end": {
"line": 44,
"column": 25
}
},
"left": {
"type": "Identifier",
"start": 1162,
"end": 1167,
"loc": {
"start": {
"line": 44,
"column": 8
},
"end": {
"line": 44,
"column": 13
},
"identifierName": "track"
},
"name": "track"
},
"right": {
"type": "Identifier",
"start": 1170,
"end": 1179,
"loc": {
"start": {
"line": 44,
"column": 16
},
"end": {
"line": 44,
"column": 25
},
"identifierName": "undefined"
},
"name": "undefined"
}
},
"extra": {
"shorthand": true
}
},
{
"type": "ObjectProperty",
"start": 1189,
"end": 1206,
"loc": {
"start": {
"line": 45,
"column": 8
},
"end": {
"line": 45,
"column": 25
}
},
"method": false,
"shorthand": true,
"computed": false,
"key": {
"type": "Identifier",
"start": 1189,
"end": 1194,
"loc": {
"start": {
"line": 45,
"column": 8
},
"end": {
"line": 45,
"column": 13
},
"identifierName": "album"
},
"name": "album"
},
"value": {
"type": "AssignmentPattern",
"start": 1189,
"end": 1206,
"loc": {
"start": {
"line": 45,
"column": 8
},
"end": {
"line": 45,
"column": 25
}
},
"left": {
"type": "Identifier",
"start": 1189,
"end": 1194,
"loc": {
"start": {
"line": 45,
"column": 8
},
"end": {
"line": 45,
"column": 13
},
"identifierName": "album"
},
"name": "album"
},
"right": {
"type": "Identifier",
"start": 1197,
"end": 1206,
"loc": {
"start": {
"line": 45,
"column": 16
},
"end": {
"line": 45,
"column": 25
},
"identifierName": "undefined"
},
"name": "undefined"
}
},
"extra": {
"shorthand": true
}
},
{
"type": "ObjectProperty",
"start": 1216,
"end": 1234,
"loc": {
"start": {
"line": 46,
"column": 8
},
"end": {
"line": 46,
"column": 26
}
},
"method": false,
"shorthand": true,
"computed": false,
"key": {
"type": "Identifier",
"start": 1216,
"end": 1222,
"loc": {
"start": {
"line": 46,
"column": 8
},
"end": {
"line": 46,
"column": 14
},
"identifierName": "artist"
},
"name": "artist"
},
"value": {
"type": "AssignmentPattern",
"start": 1216,
"end": 1234,
"loc": {
"start": {
"line": 46,
"column": 8
},
"end": {
"line": 46,
"column": 26
}
},
"left": {
"type": "Identifier",
"start": 1216,
"end": 1222,
"loc": {
"start": {
"line": 46,
"column": 8
},
"end": {
"line": 46,
"column": 14
},
"identifierName": "artist"
},
"name": "artist"
},
"right": {
"type": "Identifier",
"start": 1225,
"end": 1234,
"loc": {
"start": {
"line": 46,
"column": 17
},
"end": {
"line": 46,
"column": 26
},
"identifierName": "undefined"
},
"name": "undefined"
}
},
"extra": {
"shorthand": true
}
},
{
"type": "ObjectProperty",
"start": 1244,
"end": 1264,
"loc": {
"start": {
"line": 47,
"column": 8
},
"end": {
"line": 47,
"column": 28
}
},
"method": false,
"shorthand": true,
"computed": false,
"key": {
"type": "Identifier",
"start": 1244,
"end": 1252,
"loc": {
"start": {
"line": 47,
"column": 8
},
"end": {
"line": 47,
"column": 16
},
"identifierName": "playlist"
},
"name": "playlist"
},
"value": {
"type": "AssignmentPattern",
"start": 1244,
"end": 1264,
"loc": {
"start": {
"line": 47,
"column": 8
},
"end": {
"line": 47,
"column": 28
}
},
"left": {
"type": "Identifier",
"start": 1244,
"end": 1252,
"loc": {
"start": {
"line": 47,
"column": 8
},
"end": {
"line": 47,
"column": 16
},
"identifierName": "playlist"
},
"name": "playlist"
},
"right": {
"type": "Identifier",
"start": 1255,
"end": 1264,
"loc": {
"start": {
"line": 47,
"column": 19
},
"end": {
"line": 47,
"column": 28
},
"identifierName": "undefined"
},
"name": "undefined"
}
},
"extra": {
"shorthand": true
}
},
{
"type": "ObjectProperty",
"start": 1274,
"end": 1305,
"loc": {
"start": {
"line": 48,
"column": 8
},
"end": {
"line": 48,
"column": 39
}
},
"method": false,
"shorthand": true,
"compute