@kkbox/kkbox-js-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,734 lines • 70.6 kB
JSON
{
"type": "File",
"start": 0,
"end": 307,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 17,
"column": 1
}
},
"program": {
"type": "Program",
"start": 0,
"end": 307,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 17,
"column": 1
}
},
"sourceType": "module",
"body": [
{
"type": "ExportNamedDeclaration",
"start": 19,
"end": 200,
"loc": {
"start": {
"line": 4,
"column": 0
},
"end": {
"line": 10,
"column": 1
}
},
"specifiers": [],
"source": null,
"declaration": {
"type": "VariableDeclaration",
"start": 26,
"end": 200,
"loc": {
"start": {
"line": 4,
"column": 7
},
"end": {
"line": 10,
"column": 1
}
},
"declarations": [
{
"type": "VariableDeclarator",
"start": 32,
"end": 200,
"loc": {
"start": {
"line": 4,
"column": 13
},
"end": {
"line": 10,
"column": 1
}
},
"id": {
"type": "Identifier",
"start": 32,
"end": 40,
"loc": {
"start": {
"line": 4,
"column": 13
},
"end": {
"line": 4,
"column": 21
},
"identifierName": "apiError"
},
"name": "apiError",
"leadingComments": null
},
"init": {
"type": "ArrowFunctionExpression",
"start": 43,
"end": 200,
"loc": {
"start": {
"line": 4,
"column": 24
},
"end": {
"line": 10,
"column": 1
}
},
"id": {
"type": "Identifier",
"start": 32,
"end": 40,
"loc": {
"start": {
"line": 4,
"column": 13
},
"end": {
"line": 4,
"column": 21
},
"identifierName": "apiError"
},
"name": "apiError",
"leadingComments": null
},
"generator": false,
"expression": false,
"async": false,
"params": [
{
"type": "Identifier",
"start": 44,
"end": 49,
"loc": {
"start": {
"line": 4,
"column": 25
},
"end": {
"line": 4,
"column": 30
},
"identifierName": "error"
},
"name": "error"
}
],
"body": {
"type": "BlockStatement",
"start": 54,
"end": 200,
"loc": {
"start": {
"line": 4,
"column": 35
},
"end": {
"line": 10,
"column": 1
}
},
"body": [
{
"type": "IfStatement",
"start": 60,
"end": 198,
"loc": {
"start": {
"line": 5,
"column": 4
},
"end": {
"line": 9,
"column": 5
}
},
"test": {
"type": "MemberExpression",
"start": 64,
"end": 78,
"loc": {
"start": {
"line": 5,
"column": 8
},
"end": {
"line": 5,
"column": 22
}
},
"object": {
"type": "Identifier",
"start": 64,
"end": 69,
"loc": {
"start": {
"line": 5,
"column": 8
},
"end": {
"line": 5,
"column": 13
},
"identifierName": "error"
},
"name": "error"
},
"property": {
"type": "Identifier",
"start": 70,
"end": 78,
"loc": {
"start": {
"line": 5,
"column": 14
},
"end": {
"line": 5,
"column": 22
},
"identifierName": "response"
},
"name": "response"
},
"computed": false
},
"consequent": {
"type": "BlockStatement",
"start": 80,
"end": 146,
"loc": {
"start": {
"line": 5,
"column": 24
},
"end": {
"line": 7,
"column": 5
}
},
"body": [
{
"type": "ThrowStatement",
"start": 90,
"end": 140,
"loc": {
"start": {
"line": 6,
"column": 8
},
"end": {
"line": 6,
"column": 58
}
},
"argument": {
"type": "NewExpression",
"start": 96,
"end": 140,
"loc": {
"start": {
"line": 6,
"column": 14
},
"end": {
"line": 6,
"column": 58
}
},
"callee": {
"type": "Identifier",
"start": 100,
"end": 105,
"loc": {
"start": {
"line": 6,
"column": 18
},
"end": {
"line": 6,
"column": 23
},
"identifierName": "Error"
},
"name": "Error"
},
"arguments": [
{
"type": "MemberExpression",
"start": 106,
"end": 139,
"loc": {
"start": {
"line": 6,
"column": 24
},
"end": {
"line": 6,
"column": 57
}
},
"object": {
"type": "MemberExpression",
"start": 106,
"end": 131,
"loc": {
"start": {
"line": 6,
"column": 24
},
"end": {
"line": 6,
"column": 49
}
},
"object": {
"type": "MemberExpression",
"start": 106,
"end": 125,
"loc": {
"start": {
"line": 6,
"column": 24
},
"end": {
"line": 6,
"column": 43
}
},
"object": {
"type": "MemberExpression",
"start": 106,
"end": 120,
"loc": {
"start": {
"line": 6,
"column": 24
},
"end": {
"line": 6,
"column": 38
}
},
"object": {
"type": "Identifier",
"start": 106,
"end": 111,
"loc": {
"start": {
"line": 6,
"column": 24
},
"end": {
"line": 6,
"column": 29
},
"identifierName": "error"
},
"name": "error"
},
"property": {
"type": "Identifier",
"start": 112,
"end": 120,
"loc": {
"start": {
"line": 6,
"column": 30
},
"end": {
"line": 6,
"column": 38
},
"identifierName": "response"
},
"name": "response"
},
"computed": false
},
"property": {
"type": "Identifier",
"start": 121,
"end": 125,
"loc": {
"start": {
"line": 6,
"column": 39
},
"end": {
"line": 6,
"column": 43
},
"identifierName": "data"
},
"name": "data"
},
"computed": false
},
"property": {
"type": "Identifier",
"start": 126,
"end": 131,
"loc": {
"start": {
"line": 6,
"column": 44
},
"end": {
"line": 6,
"column": 49
},
"identifierName": "error"
},
"name": "error"
},
"computed": false
},
"property": {
"type": "Identifier",
"start": 132,
"end": 139,
"loc": {
"start": {
"line": 6,
"column": 50
},
"end": {
"line": 6,
"column": 57
},
"identifierName": "message"
},
"name": "message"
},
"computed": false
}
]
}
}
],
"directives": []
},
"alternate": {
"type": "BlockStatement",
"start": 152,
"end": 198,
"loc": {
"start": {
"line": 7,
"column": 11
},
"end": {
"line": 9,
"column": 5
}
},
"body": [
{
"type": "ThrowStatement",
"start": 162,
"end": 192,
"loc": {
"start": {
"line": 8,
"column": 8
},
"end": {
"line": 8,
"column": 38
}
},
"argument": {
"type": "NewExpression",
"start": 168,
"end": 192,
"loc": {
"start": {
"line": 8,
"column": 14
},
"end": {
"line": 8,
"column": 38
}
},
"callee": {
"type": "Identifier",
"start": 172,
"end": 177,
"loc": {
"start": {
"line": 8,
"column": 18
},
"end": {
"line": 8,
"column": 23
},
"identifierName": "Error"
},
"name": "Error"
},
"arguments": [
{
"type": "MemberExpression",
"start": 178,
"end": 191,
"loc": {
"start": {
"line": 8,
"column": 24
},
"end": {
"line": 8,
"column": 37
}
},
"object": {
"type": "Identifier",
"start": 178,
"end": 183,
"loc": {
"start": {
"line": 8,
"column": 24
},
"end": {
"line": 8,
"column": 29
},
"identifierName": "error"
},
"name": "error"
},
"property": {
"type": "Identifier",
"start": 184,
"end": 191,
"loc": {
"start": {
"line": 8,
"column": 30
},
"end": {
"line": 8,
"column": 37
},
"identifierName": "message"
},
"name": "message"
},
"computed": false
}
]
}
}
],
"directives": []
}
}
],
"directives": [],
"trailingComments": null
},
"trailingComments": null
},
"leadingComments": null,
"trailingComments": null
}
],
"kind": "const",
"leadingComments": [
{
"type": "CommentBlock",
"value": "*\n * @ignore\n ",
"start": 0,
"end": 18,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 3,
"column": 3
}
}
}
],
"trailingComments": [
{
"type": "CommentBlock",
"value": "*\n * @ignore\n ",
"start": 202,
"end": 220,
"loc": {
"start": {
"line": 12,
"column": 0
},
"end": {
"line": 14,
"column": 3
}
}
}
]
},
"leadingComments": [
{
"type": "CommentBlock",
"value": "*\n * @ignore\n ",
"start": 0,
"end": 18,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 3,
"column": 3
}
}
}
],
"trailingComments": [
{
"type": "CommentBlock",
"value": "*\n * @ignore\n ",
"start": 202,
"end": 220,
"loc": {
"start": {
"line": 12,
"column": 0
},
"end": {
"line": 14,
"column": 3
}
}
}
]
},
{
"type": "ExportNamedDeclaration",
"start": 221,
"end": 307,
"loc": {
"start": {
"line": 15,
"column": 0
},
"end": {
"line": 17,
"column": 1
}
},
"specifiers": [],
"source": null,
"declaration": {
"type": "VariableDeclaration",
"start": 228,
"end": 307,
"loc": {
"start": {
"line": 15,
"column": 7
},
"end": {
"line": 17,
"column": 1
}
},
"declarations": [
{
"type": "VariableDeclarator",
"start": 234,
"end": 307,
"loc": {
"start": {
"line": 15,
"column": 13
},
"end": {
"line": 17,
"column": 1
}
},
"id": {
"type": "Identifier",
"start": 234,
"end": 243,
"loc": {
"start": {
"line": 15,
"column": 13
},
"end": {
"line": 15,
"column": 22
},
"identifierName": "authError"
},
"name": "authError",
"leadingComments": null
},
"init": {
"type": "ArrowFunctionExpression",
"start": 246,
"end": 307,
"loc": {
"start": {
"line": 15,
"column": 25
},
"end": {
"line": 17,
"column": 1
}
},
"id": {
"type": "Identifier",
"start": 234,
"end": 243,
"loc": {
"start": {
"line": 15,
"column": 13
},
"end": {
"line": 15,
"column": 22
},
"identifierName": "authError"
},
"name": "authError",
"leadingComments": null
},
"generator": false,
"expression": false,
"async": false,
"params": [
{
"type": "Identifier",
"start": 247,
"end": 252,
"loc": {
"start": {
"line": 15,
"column": 26
},
"end": {
"line": 15,
"column": 31
},
"identifierName": "error"
},
"name": "error"
}
],
"body": {
"type": "BlockStatement",
"start": 257,
"end": 307,
"loc": {
"start": {
"line": 15,
"column": 36
},
"end": {
"line": 17,
"column": 1
}
},
"body": [
{
"type": "ThrowStatement",
"start": 263,
"end": 305,
"loc": {
"start": {
"line": 16,
"column": 4
},
"end": {
"line": 16,
"column": 46
}
},
"argument": {
"type": "NewExpression",
"start": 269,
"end": 305,
"loc": {
"start": {
"line": 16,
"column": 10
},
"end": {
"line": 16,
"column": 46
}
},
"callee": {
"type": "Identifier",
"start": 273,
"end": 278,
"loc": {
"start": {
"line": 16,
"column": 14
},
"end": {
"line": 16,
"column": 19
},
"identifierName": "Error"
},
"name": "Error"
},
"arguments": [
{
"type": "MemberExpression",
"start": 279,
"end": 304,
"loc": {
"start": {
"line": 16,
"column": 20
},
"end": {
"line": 16,
"column": 45
}
},
"object": {
"type": "MemberExpression",
"start": 279,
"end": 298,
"loc": {
"start": {
"line": 16,
"column": 20
},
"end": {
"line": 16,
"column": 39
}
},
"object": {
"type": "MemberExpression",
"start": 279,
"end": 293,
"loc": {
"start": {
"line": 16,
"column": 20
},
"end": {
"line": 16,
"column": 34
}
},
"object": {
"type": "Identifier",
"start": 279,
"end": 284,
"loc": {
"start": {
"line": 16,
"column": 20
},
"end": {
"line": 16,
"column": 25
},
"identifierName": "error"
},
"name": "error"
},
"property": {
"type": "Identifier",
"start": 285,
"end": 293,
"loc": {
"start": {
"line": 16,
"column": 26
},
"end": {
"line": 16,
"column": 34
},
"identifierName": "response"
},
"name": "response"
},
"computed": false
},
"property": {
"type": "Identifier",
"start": 294,
"end": 298,
"loc": {
"start": {
"line": 16,
"column": 35
},
"end": {
"line": 16,
"column": 39
},
"identifierName": "data"
},
"name": "data"
},
"computed": false
},
"property": {
"type": "Identifier",
"start": 299,
"end": 304,
"loc": {
"start": {
"line": 16,
"column": 40
},
"end": {
"line": 16,
"column": 45
},
"identifierName": "error"
},
"name": "error"
},
"computed": false
}
]
}
}
],
"directives": []
}
},
"leadingComments": null
}
],
"kind": "const",
"leadingComments": [
{
"type": "CommentBlock",
"value": "*\n * @ignore\n ",
"start": 202,
"end": 220,
"loc": {
"start": {
"line": 12,
"column": 0
},
"end": {
"line": 14,
"column": 3
}
}
}
],
"trailingComments": []
},
"leadingComments": [
{
"type": "CommentBlock",
"value": "*\n * @ignore\n ",
"start": 202,
"end": 220,
"loc": {
"start": {
"line": 12,
"column": 0
},
"end": {
"line": 14,
"column": 3
}
}
}
]
}
],
"directives": []
},
"comments": [
{
"type": "CommentBlock",
"value": "*\n * @ignore\n ",
"start": 0,
"end": 18,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 3,
"column": 3
}
}
},
{
"type": "CommentBlock",
"value": "*\n * @ignore\n ",
"start": 202,
"end": 220,
"loc": {
"start": {
"line": 12,
"column": 0
},
"end": {
"line": 14,
"column": 3
}
}
}
],
"tokens": [
{
"type": "CommentBlock",
"value": "*\n * @ignore\n ",
"start": 0,
"end": 18,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 3,
"column": 3
}
}
},
{
"type": {
"label": "export",
"keyword": "export",
"beforeExpr": false,
"startsExpr": false,
"rightAssociative": false,
"isLoop": false,
"isAssign": false,
"prefix": false,
"postfix": false,
"binop": null,
"updateContext": null
},
"value": "export",
"start": 19,
"end": 25,
"loc": {
"start": {
"line": 4,
"column": 0
},
"end": {
"line": 4,
"column": 6
}
}
},
{
"type": {
"label": "const",
"keyword": "const",
"beforeExpr": false,
"startsExpr": false,
"rightAssociative": false,
"isLoop": false,
"isAssign": false,
"prefix": false,
"postfix": false,
"binop": null,
"updateContext": null
},
"value": "const",
"start": 26,
"end": 31,
"loc": {
"start": {
"line": 4,
"column": 7
},
"end": {
"line": 4,
"column": 12
}
}
},
{
"type": {
"label": "name",
"beforeExpr": false,
"startsExpr": true,
"rightAssociative": false,
"isLoop": false,
"isAssign": false,
"prefix": false,
"postfix": false,
"binop": null
},
"value": "apiError",
"start": 32,
"end": 40,
"loc": {
"start": {
"line": 4,
"column": 13
},
"end": {
"line": 4,
"column": 21
}
}
},
{
"type": {
"label": "=",
"beforeExpr": true,
"startsExpr": false,
"rightAssociative": false,
"isLoop": false,
"isAssign": true,
"prefix": false,
"postfix": false,
"binop": null,
"updateContext": null
},
"value": "=",
"start": 41,
"end": 42,
"loc": {
"start": {
"line": 4,
"column": 22
},
"end": {
"line": 4,
"column": 23
}
}
},
{
"type": {
"label": "(",
"beforeExpr": true,
"startsExpr": true,
"rightAssociative": false,
"isLoop": false,
"isAssign": false,
"prefix": false,
"postfix": false,
"binop": null
},
"start": 43,
"end": 44,
"loc": {
"start": {
"line": 4,
"column": 24
},
"end": {
"line": 4,
"column": 25
}
}
},
{
"type": {
"label": "name",
"beforeExpr": false,
"startsExpr": true,
"rightAssociative": false,
"isLoop": false,
"isAssign": false,
"prefix": false,
"postfix": false,
"binop": null
},
"value": "error",
"start": 44,
"end": 49,
"loc": {
"start": {
"line": 4,
"column": 25
},
"end": {
"line": 4,
"column": 30
}
}
},
{
"type": {
"label": ")",
"beforeExpr": false,
"startsExpr": false,
"rightAssociative": false,
"isLoop": false,
"isAssign": false,
"prefix": false,
"postfix": false,
"binop": null
},
"start": 49,
"end": 50,
"loc": {
"start": {
"line": 4,
"column": 30
},
"end": {
"line": 4,
"column": 31
}
}
},
{
"type": {
"label": "=>",
"beforeExpr": true,
"startsExpr": false,
"rightAssociative": false,
"isLoop": false,
"isAssign": false,
"prefix": false,
"postfix": false,
"binop": null,
"updateContext": null
},
"start": 51,
"end": 53,
"loc": {
"start": {
"line": 4,
"column": 32
},
"end": {
"line": 4,
"column": 34
}
}
},
{
"type": {
"label": "{",
"beforeExpr": true,
"startsExpr": true,
"rightAssociative": false,
"isLoop": false,
"isAssign": false,
"prefix": false,
"postfix": false,
"binop": null
},
"start": 54,
"end": 55,
"loc": {
"start": {
"line": 4,
"column": 35
},
"end": {
"line": 4,
"column": 36
}
}
},
{
"type": {
"label": "if",
"keyword": "if",
"beforeExpr": false,
"startsExpr": false,
"rightAssociative": false,
"isLoop": false,
"isAssign": false,
"prefix": false,
"postfix": false,
"binop": null,
"updateContext": null
},
"value": "if",
"start": 60,
"end": 62,
"loc": {
"start": {
"line": 5,
"column": 4
},
"end": {
"line": 5,
"column": 6
}
}
},
{
"type": {
"label": "(",
"beforeExpr": true,
"startsExpr": true,
"rightAssociative": false,
"isLoop": false,
"isAssign": false,
"prefix": false,
"postfix": false,
"binop": null
},
"start": 63,
"end": 64,
"loc": {
"start": {
"line": 5,
"column": 7
},
"end": {
"line": 5,
"column": 8
}
}
},
{
"type": {
"label": "name",
"beforeExpr": false,
"startsExpr": true,
"rightAssociative": false,
"isLoop": false,
"isAssign": false,
"prefix": false,
"postfix": false,
"binop": null
},
"value": "error",
"start": 64,
"end": 69,
"loc": {
"start": {
"line": 5,
"column": 8
},
"end": {
"line": 5,
"column": 13
}
}
},
{
"type": {
"label": ".",
"beforeExpr": false,
"startsExpr": false,
"rightAssociative": false,
"isLoop": false,
"isAssign": false,
"prefix": false,
"postfix": false,
"binop": null,
"updateContext": null
},
"start": 69,
"end": 70,
"loc": {
"start": {
"line": 5,
"column": 13
},
"end": {
"line": 5,
"column": 14
}
}
},
{
"type": {
"label": "name",
"beforeExpr": false,
"startsExpr": true,
"rightAssociative": false,
"isLoop": false,
"isAssign": false,
"prefix": false,
"postfix": false,
"binop": null
},
"value": "response",
"start": 70,
"end": 78,
"loc": {
"start": {
"line": 5,
"column": 14
},
"end": {
"line": 5,
"column": 22
}
}
},
{
"type": {
"label": ")",
"beforeExpr": false,
"startsExpr": false,
"rightAssociative": false,
"isLoop": false,
"isAssign": false,
"prefix": false,
"postfix": false,
"binop": null
},
"start": 78,
"end": 79,
"loc": {
"start": {
"line": 5,
"column": 22
},
"end": {
"line": 5,
"column": 23
}
}
},
{
"type": {
"label": "{",
"beforeExpr": true,
"startsExpr": true,
"rightAssociative": false,
"isLoop": false,
"isAssign": false,
"prefix": false,
"postfix": false,
"binop": null
},
"start": 80,
"end": 81,
"loc": {
"start": {
"line": 5,
"column": 24
},
"end": {
"line": 5,
"column": 25
}
}
},
{
"type": {
"label": "throw",
"keyword": "throw",
"beforeExpr": true,
"startsExpr": false,
"rightAssociative": false,
"isLoop": false,
"isAssign": false,
"prefix": false,
"postfix": false,
"binop": null,
"updateContext": null
},
"value": "throw",
"start": 90,
"end": 95,
"loc": {
"start": {
"line": 6,
"column": 8
},
"end": {
"line": 6,
"column": 13
}
}
},
{
"type": {
"label": "new",
"keyword": "new",
"beforeExpr": true,
"startsExpr": true,
"rightAssociative": false,
"isLoop": false,
"isAssign": false,
"prefix": false,
"postfix": false,
"binop": null,
"updateContext": null
},
"value": "new",
"start": 96,
"end": 99,
"loc": {
"start": {
"line": 6,
"column": 14
},
"end": {
"line": 6,
"column": 17
}
}
},
{
"type": {
"label": "name",
"beforeExpr": false,
"startsExpr": true,
"rightAssociative": false,
"isLoop": false,
"isAssign": false,
"prefix": false,
"postfix": false,
"binop": null
},
"value": "Error",
"start": 100,
"end": 105,
"loc": {
"start": {
"line": 6,
"column": 18
},
"end": {
"line": 6,
"column": 23
}
}
},
{
"type": {
"label": "(",
"beforeExpr": true,
"startsExpr": true,
"rightAssociative": false,
"isLoop": false,
"isAssign": false,
"prefix": false,
"postfix": false,
"binop": null
},
"start": 105,
"end": 106,
"loc": {
"start": {
"line": 6,
"column": 23
},
"end": {
"line": 6,
"column": 24
}
}
},
{
"type": {
"label": "name",
"beforeExpr": false,
"startsExpr": true,
"rightAssociative": false,
"isLoop": false,
"isAssign": false,
"prefix": false,
"postfix": false,
"binop": null
},
"value": "error",
"start": 106,
"end": 111,
"loc": {
"start": {
"line": 6,
"column": 24
},
"end": {
"line": 6,
"column": 29
}
}
},
{
"type": {
"label": ".",
"beforeExpr": false,
"startsExpr": false,
"rightAssociative": false,
"isLoop": false,
"isAssign": false,
"prefix": false,
"postfix": false,
"binop": null,
"updateContext": null
},
"start": 111,
"end": 112,
"loc": {
"start": {
"line": 6,
"column": 29
},
"end": {
"line": 6,
"column": 30
}
}
},
{
"type": {
"label": "name",
"beforeExpr": false,
"startsExpr": true,
"rightAssociative": false,
"isLoop": false,
"isAssign": false,
"prefix": false,
"postfix": false,
"binop": null
},
"value": "response",
"start": 112,
"end": 120,
"loc": {
"start": {
"line": 6,
"column": 30
},
"end": {
"line": 6,
"column": 38
}
}
},
{
"type": {
"label": ".",
"beforeExpr": false,
"startsExpr": false,
"rightAssociative": false,
"isLoop": false,
"isAssign": false,
"prefix": false,
"postfix": false,
"binop": null,
"updateContext": null
},
"start": 120,
"end": 121,
"loc": {
"start": {
"line": 6,
"column": 38
},
"end": {
"line": 6,
"column": 39
}
}
},
{
"type": {
"label": "name",
"beforeExpr": false,
"startsExpr": true,
"rightAssociative": false,
"isLoop": false,
"isAssign": false,
"prefix": false,
"postfix": false,
"binop": null
},
"value": "data",
"start": 121,
"end": 125,
"loc": {
"start": {
"line": 6,
"column": 39
},
"end": {
"line": 6,
"column": 43
}
}
},
{
"type": {
"label": ".",
"beforeExpr": false,
"startsExpr": false,
"rightAssociative": false,
"isLoop": false,
"isAssign": false,
"prefix": false,
"postfix": false,
"binop": null,
"updateContext": null
},
"start": 125,
"end": 126,
"loc": {
"start": {
"line": 6,
"column": 43
},
"end": {
"line": 6,
"column": 44
}
}
},
{
"type": {
"label": "name",
"beforeExpr": false,
"startsExpr": true,
"rightAssociative": false,
"isLoop": false,
"isAssign": false,
"prefix": false,
"postfix": false,
"bi