UNPKG

@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,737 lines 71.1 kB
{ "type": "File", "start": 0, "end": 293, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 18, "column": 0 } }, "program": { "type": "Program", "start": 0, "end": 293, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 18, "column": 0 } }, "sourceType": "module", "body": [ { "type": "ExportNamedDeclaration", "start": 19, "end": 187, "loc": { "start": { "line": 4, "column": 0 }, "end": { "line": 10, "column": 2 } }, "specifiers": [], "source": null, "declaration": { "type": "VariableDeclaration", "start": 26, "end": 187, "loc": { "start": { "line": 4, "column": 7 }, "end": { "line": 10, "column": 2 } }, "declarations": [ { "type": "VariableDeclarator", "start": 32, "end": 186, "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": 186, "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": 43, "end": 48, "loc": { "start": { "line": 4, "column": 24 }, "end": { "line": 4, "column": 29 }, "identifierName": "error" }, "name": "error" } ], "body": { "type": "BlockStatement", "start": 52, "end": 186, "loc": { "start": { "line": 4, "column": 33 }, "end": { "line": 10, "column": 1 } }, "body": [ { "type": "IfStatement", "start": 56, "end": 184, "loc": { "start": { "line": 5, "column": 2 }, "end": { "line": 9, "column": 3 } }, "test": { "type": "MemberExpression", "start": 60, "end": 74, "loc": { "start": { "line": 5, "column": 6 }, "end": { "line": 5, "column": 20 } }, "object": { "type": "Identifier", "start": 60, "end": 65, "loc": { "start": { "line": 5, "column": 6 }, "end": { "line": 5, "column": 11 }, "identifierName": "error" }, "name": "error" }, "property": { "type": "Identifier", "start": 66, "end": 74, "loc": { "start": { "line": 5, "column": 12 }, "end": { "line": 5, "column": 20 }, "identifierName": "response" }, "name": "response" }, "computed": false }, "consequent": { "type": "BlockStatement", "start": 76, "end": 137, "loc": { "start": { "line": 5, "column": 22 }, "end": { "line": 7, "column": 3 } }, "body": [ { "type": "ThrowStatement", "start": 82, "end": 133, "loc": { "start": { "line": 6, "column": 4 }, "end": { "line": 6, "column": 55 } }, "argument": { "type": "NewExpression", "start": 88, "end": 132, "loc": { "start": { "line": 6, "column": 10 }, "end": { "line": 6, "column": 54 } }, "callee": { "type": "Identifier", "start": 92, "end": 97, "loc": { "start": { "line": 6, "column": 14 }, "end": { "line": 6, "column": 19 }, "identifierName": "Error" }, "name": "Error" }, "arguments": [ { "type": "MemberExpression", "start": 98, "end": 131, "loc": { "start": { "line": 6, "column": 20 }, "end": { "line": 6, "column": 53 } }, "object": { "type": "MemberExpression", "start": 98, "end": 123, "loc": { "start": { "line": 6, "column": 20 }, "end": { "line": 6, "column": 45 } }, "object": { "type": "MemberExpression", "start": 98, "end": 117, "loc": { "start": { "line": 6, "column": 20 }, "end": { "line": 6, "column": 39 } }, "object": { "type": "MemberExpression", "start": 98, "end": 112, "loc": { "start": { "line": 6, "column": 20 }, "end": { "line": 6, "column": 34 } }, "object": { "type": "Identifier", "start": 98, "end": 103, "loc": { "start": { "line": 6, "column": 20 }, "end": { "line": 6, "column": 25 }, "identifierName": "error" }, "name": "error" }, "property": { "type": "Identifier", "start": 104, "end": 112, "loc": { "start": { "line": 6, "column": 26 }, "end": { "line": 6, "column": 34 }, "identifierName": "response" }, "name": "response" }, "computed": false }, "property": { "type": "Identifier", "start": 113, "end": 117, "loc": { "start": { "line": 6, "column": 35 }, "end": { "line": 6, "column": 39 }, "identifierName": "data" }, "name": "data" }, "computed": false }, "property": { "type": "Identifier", "start": 118, "end": 123, "loc": { "start": { "line": 6, "column": 40 }, "end": { "line": 6, "column": 45 }, "identifierName": "error" }, "name": "error" }, "computed": false }, "property": { "type": "Identifier", "start": 124, "end": 131, "loc": { "start": { "line": 6, "column": 46 }, "end": { "line": 6, "column": 53 }, "identifierName": "message" }, "name": "message" }, "computed": false } ] } } ], "directives": [] }, "alternate": { "type": "BlockStatement", "start": 143, "end": 184, "loc": { "start": { "line": 7, "column": 9 }, "end": { "line": 9, "column": 3 } }, "body": [ { "type": "ThrowStatement", "start": 149, "end": 180, "loc": { "start": { "line": 8, "column": 4 }, "end": { "line": 8, "column": 35 } }, "argument": { "type": "NewExpression", "start": 155, "end": 179, "loc": { "start": { "line": 8, "column": 10 }, "end": { "line": 8, "column": 34 } }, "callee": { "type": "Identifier", "start": 159, "end": 164, "loc": { "start": { "line": 8, "column": 14 }, "end": { "line": 8, "column": 19 }, "identifierName": "Error" }, "name": "Error" }, "arguments": [ { "type": "MemberExpression", "start": 165, "end": 178, "loc": { "start": { "line": 8, "column": 20 }, "end": { "line": 8, "column": 33 } }, "object": { "type": "Identifier", "start": 165, "end": 170, "loc": { "start": { "line": 8, "column": 20 }, "end": { "line": 8, "column": 25 }, "identifierName": "error" }, "name": "error" }, "property": { "type": "Identifier", "start": 171, "end": 178, "loc": { "start": { "line": 8, "column": 26 }, "end": { "line": 8, "column": 33 }, "identifierName": "message" }, "name": "message" }, "computed": false } ] } } ], "directives": [] } } ], "directives": [] } }, "leadingComments": 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": 189, "end": 207, "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": 189, "end": 207, "loc": { "start": { "line": 12, "column": 0 }, "end": { "line": 14, "column": 3 } } } ] }, { "type": "ExportNamedDeclaration", "start": 208, "end": 292, "loc": { "start": { "line": 15, "column": 0 }, "end": { "line": 17, "column": 2 } }, "specifiers": [], "source": null, "declaration": { "type": "VariableDeclaration", "start": 215, "end": 292, "loc": { "start": { "line": 15, "column": 7 }, "end": { "line": 17, "column": 2 } }, "declarations": [ { "type": "VariableDeclarator", "start": 221, "end": 291, "loc": { "start": { "line": 15, "column": 13 }, "end": { "line": 17, "column": 1 } }, "id": { "type": "Identifier", "start": 221, "end": 230, "loc": { "start": { "line": 15, "column": 13 }, "end": { "line": 15, "column": 22 }, "identifierName": "authError" }, "name": "authError", "leadingComments": null }, "init": { "type": "ArrowFunctionExpression", "start": 233, "end": 291, "loc": { "start": { "line": 15, "column": 25 }, "end": { "line": 17, "column": 1 } }, "id": { "type": "Identifier", "start": 221, "end": 230, "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": 233, "end": 238, "loc": { "start": { "line": 15, "column": 25 }, "end": { "line": 15, "column": 30 }, "identifierName": "error" }, "name": "error" } ], "body": { "type": "BlockStatement", "start": 242, "end": 291, "loc": { "start": { "line": 15, "column": 34 }, "end": { "line": 17, "column": 1 } }, "body": [ { "type": "ThrowStatement", "start": 246, "end": 289, "loc": { "start": { "line": 16, "column": 2 }, "end": { "line": 16, "column": 45 } }, "argument": { "type": "NewExpression", "start": 252, "end": 288, "loc": { "start": { "line": 16, "column": 8 }, "end": { "line": 16, "column": 44 } }, "callee": { "type": "Identifier", "start": 256, "end": 261, "loc": { "start": { "line": 16, "column": 12 }, "end": { "line": 16, "column": 17 }, "identifierName": "Error" }, "name": "Error" }, "arguments": [ { "type": "MemberExpression", "start": 262, "end": 287, "loc": { "start": { "line": 16, "column": 18 }, "end": { "line": 16, "column": 43 } }, "object": { "type": "MemberExpression", "start": 262, "end": 281, "loc": { "start": { "line": 16, "column": 18 }, "end": { "line": 16, "column": 37 } }, "object": { "type": "MemberExpression", "start": 262, "end": 276, "loc": { "start": { "line": 16, "column": 18 }, "end": { "line": 16, "column": 32 } }, "object": { "type": "Identifier", "start": 262, "end": 267, "loc": { "start": { "line": 16, "column": 18 }, "end": { "line": 16, "column": 23 }, "identifierName": "error" }, "name": "error" }, "property": { "type": "Identifier", "start": 268, "end": 276, "loc": { "start": { "line": 16, "column": 24 }, "end": { "line": 16, "column": 32 }, "identifierName": "response" }, "name": "response" }, "computed": false }, "property": { "type": "Identifier", "start": 277, "end": 281, "loc": { "start": { "line": 16, "column": 33 }, "end": { "line": 16, "column": 37 }, "identifierName": "data" }, "name": "data" }, "computed": false }, "property": { "type": "Identifier", "start": 282, "end": 287, "loc": { "start": { "line": 16, "column": 38 }, "end": { "line": 16, "column": 43 }, "identifierName": "error" }, "name": "error" }, "computed": false } ] } } ], "directives": [] } }, "leadingComments": null } ], "kind": "const", "leadingComments": [ { "type": "CommentBlock", "value": "*\n * @ignore\n ", "start": 189, "end": 207, "loc": { "start": { "line": 12, "column": 0 }, "end": { "line": 14, "column": 3 } } } ], "trailingComments": [] }, "leadingComments": [ { "type": "CommentBlock", "value": "*\n * @ignore\n ", "start": 189, "end": 207, "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": 189, "end": 207, "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": "name", "beforeExpr": false, "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null }, "value": "error", "start": 43, "end": 48, "loc": { "start": { "line": 4, "column": 24 }, "end": { "line": 4, "column": 29 } } }, { "type": { "label": "=>", "beforeExpr": true, "startsExpr": false, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null, "updateContext": null }, "start": 49, "end": 51, "loc": { "start": { "line": 4, "column": 30 }, "end": { "line": 4, "column": 32 } } }, { "type": { "label": "{", "beforeExpr": true, "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null }, "start": 52, "end": 53, "loc": { "start": { "line": 4, "column": 33 }, "end": { "line": 4, "column": 34 } } }, { "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": 56, "end": 58, "loc": { "start": { "line": 5, "column": 2 }, "end": { "line": 5, "column": 4 } } }, { "type": { "label": "(", "beforeExpr": true, "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null }, "start": 59, "end": 60, "loc": { "start": { "line": 5, "column": 5 }, "end": { "line": 5, "column": 6 } } }, { "type": { "label": "name", "beforeExpr": false, "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null }, "value": "error", "start": 60, "end": 65, "loc": { "start": { "line": 5, "column": 6 }, "end": { "line": 5, "column": 11 } } }, { "type": { "label": ".", "beforeExpr": false, "startsExpr": false, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null, "updateContext": null }, "start": 65, "end": 66, "loc": { "start": { "line": 5, "column": 11 }, "end": { "line": 5, "column": 12 } } }, { "type": { "label": "name", "beforeExpr": false, "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null }, "value": "response", "start": 66, "end": 74, "loc": { "start": { "line": 5, "column": 12 }, "end": { "line": 5, "column": 20 } } }, { "type": { "label": ")", "beforeExpr": false, "startsExpr": false, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null }, "start": 74, "end": 75, "loc": { "start": { "line": 5, "column": 20 }, "end": { "line": 5, "column": 21 } } }, { "type": { "label": "{", "beforeExpr": true, "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null }, "start": 76, "end": 77, "loc": { "start": { "line": 5, "column": 22 }, "end": { "line": 5, "column": 23 } } }, { "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": 82, "end": 87, "loc": { "start": { "line": 6, "column": 4 }, "end": { "line": 6, "column": 9 } } }, { "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": 88, "end": 91, "loc": { "start": { "line": 6, "column": 10 }, "end": { "line": 6, "column": 13 } } }, { "type": { "label": "name", "beforeExpr": false, "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null }, "value": "Error", "start": 92, "end": 97, "loc": { "start": { "line": 6, "column": 14 }, "end": { "line": 6, "column": 19 } } }, { "type": { "label": "(", "beforeExpr": true, "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null }, "start": 97, "end": 98, "loc": { "start": { "line": 6, "column": 19 }, "end": { "line": 6, "column": 20 } } }, { "type": { "label": "name", "beforeExpr": false, "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null }, "value": "error", "start": 98, "end": 103, "loc": { "start": { "line": 6, "column": 20 }, "end": { "line": 6, "column": 25 } } }, { "type": { "label": ".", "beforeExpr": false, "startsExpr": false, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null, "updateContext": null }, "start": 103, "end": 104, "loc": { "start": { "line": 6, "column": 25 }, "end": { "line": 6, "column": 26 } } }, { "type": { "label": "name", "beforeExpr": false, "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null }, "value": "response", "start": 104, "end": 112, "loc": { "start": { "line": 6, "column": 26 }, "end": { "line": 6, "column": 34 } } }, { "type": { "label": ".", "beforeExpr": false, "startsExpr": false, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null, "updateContext": null }, "start": 112, "end": 113, "loc": { "start": { "line": 6, "column": 34 }, "end": { "line": 6, "column": 35 } } }, { "type": { "label": "name", "beforeExpr": false, "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null }, "value": "data", "start": 113, "end": 117, "loc": { "start": { "line": 6, "column": 35 }, "end": { "line": 6, "column": 39 } } }, { "type": { "label": ".", "beforeExpr": false, "startsExpr": false, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null, "updateContext": null }, "start": 117, "end": 118, "loc": { "start": { "line": 6, "column": 39 }, "end": { "line": 6, "column": 40 } } }, { "type": { "label": "name", "beforeExpr": false, "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null }, "value": "error", "start": 118, "end": 123, "loc": { "start": { "line": 6, "column": 40 }, "end": { "line": 6, "column": 45 } } }, { "type": { "label": ".", "beforeExpr": false, "startsExpr": false, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null, "updateContext": null }, "start": 123, "end": 124, "loc": { "start": { "line": 6, "column": 45 }, "end": { "line": 6, "column": 46 } } }, { "type": { "label": "name", "beforeExpr": false, "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null }, "value": "message", "start": 124, "end":