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,816 lines (1,815 loc) 184 kB
{ "type": "File", "start": 0, "end": 1446, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 84, "column": 56 } }, "program": { "type": "Program", "start": 0, "end": 1446, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 84, "column": 56 } }, "sourceType": "module", "body": [ { "type": "VariableDeclaration", "start": 0, "end": 150, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 3, "column": 4 } }, "declarations": [ { "type": "VariableDeclarator", "start": 6, "end": 150, "loc": { "start": { "line": 1, "column": 6 }, "end": { "line": 3, "column": 4 } }, "id": { "type": "Identifier", "start": 6, "end": 16, "loc": { "start": { "line": 1, "column": 6 }, "end": { "line": 1, "column": 16 }, "identifierName": "API_DOMAIN" }, "name": "API_DOMAIN" }, "init": { "type": "CallExpression", "start": 19, "end": 150, "loc": { "start": { "line": 1, "column": 19 }, "end": { "line": 3, "column": 4 } }, "callee": { "type": "ArrowFunctionExpression", "start": 20, "end": 147, "loc": { "start": { "line": 1, "column": 20 }, "end": { "line": 3, "column": 1 } }, "id": null, "generator": false, "expression": false, "async": false, "params": [], "body": { "type": "BlockStatement", "start": 26, "end": 147, "loc": { "start": { "line": 1, "column": 26 }, "end": { "line": 3, "column": 1 } }, "body": [ { "type": "ReturnStatement", "start": 32, "end": 145, "loc": { "start": { "line": 2, "column": 4 }, "end": { "line": 2, "column": 117 } }, "argument": { "type": "ConditionalExpression", "start": 39, "end": 145, "loc": { "start": { "line": 2, "column": 11 }, "end": { "line": 2, "column": 117 } }, "test": { "type": "BinaryExpression", "start": 39, "end": 73, "loc": { "start": { "line": 2, "column": 11 }, "end": { "line": 2, "column": 45 } }, "left": { "type": "MemberExpression", "start": 39, "end": 59, "loc": { "start": { "line": 2, "column": 11 }, "end": { "line": 2, "column": 31 } }, "object": { "type": "MemberExpression", "start": 39, "end": 50, "loc": { "start": { "line": 2, "column": 11 }, "end": { "line": 2, "column": 22 } }, "object": { "type": "Identifier", "start": 39, "end": 46, "loc": { "start": { "line": 2, "column": 11 }, "end": { "line": 2, "column": 18 }, "identifierName": "process" }, "name": "process" }, "property": { "type": "Identifier", "start": 47, "end": 50, "loc": { "start": { "line": 2, "column": 19 }, "end": { "line": 2, "column": 22 }, "identifierName": "env" }, "name": "env" }, "computed": false }, "property": { "type": "Identifier", "start": 51, "end": 59, "loc": { "start": { "line": 2, "column": 23 }, "end": { "line": 2, "column": 31 }, "identifierName": "NODE_ENV" }, "name": "NODE_ENV" }, "computed": false }, "operator": "===", "right": { "type": "StringLiteral", "start": 64, "end": 73, "loc": { "start": { "line": 2, "column": 36 }, "end": { "line": 2, "column": 45 } }, "extra": { "rawValue": "staging", "raw": "'staging'" }, "value": "staging" } }, "consequent": { "type": "StringLiteral", "start": 76, "end": 113, "loc": { "start": { "line": 2, "column": 48 }, "end": { "line": 2, "column": 85 } }, "extra": { "rawValue": "https://api.kkbox-staging.com/v1.1/", "raw": "'https://api.kkbox-staging.com/v1.1/'" }, "value": "https://api.kkbox-staging.com/v1.1/" }, "alternate": { "type": "StringLiteral", "start": 116, "end": 145, "loc": { "start": { "line": 2, "column": 88 }, "end": { "line": 2, "column": 117 } }, "extra": { "rawValue": "https://api.kkbox.com/v1.1/", "raw": "'https://api.kkbox.com/v1.1/'" }, "value": "https://api.kkbox.com/v1.1/" } } } ], "directives": [] }, "extra": { "parenthesized": true, "parenStart": 19 } }, "arguments": [], "trailingComments": null }, "trailingComments": null } ], "kind": "const", "trailingComments": [ { "type": "CommentBlock", "value": "*\n * @ignore\n ", "start": 151, "end": 169, "loc": { "start": { "line": 4, "column": 0 }, "end": { "line": 6, "column": 3 } } } ] }, { "type": "ExportNamedDeclaration", "start": 170, "end": 214, "loc": { "start": { "line": 7, "column": 0 }, "end": { "line": 7, "column": 44 } }, "specifiers": [], "source": null, "declaration": { "type": "VariableDeclaration", "start": 177, "end": 214, "loc": { "start": { "line": 7, "column": 7 }, "end": { "line": 7, "column": 44 } }, "declarations": [ { "type": "VariableDeclarator", "start": 183, "end": 214, "loc": { "start": { "line": 7, "column": 13 }, "end": { "line": 7, "column": 44 } }, "id": { "type": "Identifier", "start": 183, "end": 189, "loc": { "start": { "line": 7, "column": 13 }, "end": { "line": 7, "column": 19 }, "identifierName": "SEARCH" }, "name": "SEARCH", "leadingComments": null }, "init": { "type": "BinaryExpression", "start": 192, "end": 214, "loc": { "start": { "line": 7, "column": 22 }, "end": { "line": 7, "column": 44 } }, "left": { "type": "Identifier", "start": 192, "end": 202, "loc": { "start": { "line": 7, "column": 22 }, "end": { "line": 7, "column": 32 }, "identifierName": "API_DOMAIN" }, "name": "API_DOMAIN" }, "operator": "+", "right": { "type": "StringLiteral", "start": 205, "end": 214, "loc": { "start": { "line": 7, "column": 35 }, "end": { "line": 7, "column": 44 } }, "extra": { "rawValue": "search/", "raw": "'search/'" }, "value": "search/", "leadingComments": null, "trailingComments": null }, "trailingComments": null }, "leadingComments": null, "trailingComments": null } ], "kind": "const", "leadingComments": [ { "type": "CommentBlock", "value": "*\n * @ignore\n ", "start": 151, "end": 169, "loc": { "start": { "line": 4, "column": 0 }, "end": { "line": 6, "column": 3 } } } ], "trailingComments": [ { "type": "CommentBlock", "value": "*\n * @ignore\n ", "start": 216, "end": 234, "loc": { "start": { "line": 9, "column": 0 }, "end": { "line": 11, "column": 3 } } } ] }, "leadingComments": [ { "type": "CommentBlock", "value": "*\n * @ignore\n ", "start": 151, "end": 169, "loc": { "start": { "line": 4, "column": 0 }, "end": { "line": 6, "column": 3 } } } ], "trailingComments": [ { "type": "CommentBlock", "value": "*\n * @ignore\n ", "start": 216, "end": 234, "loc": { "start": { "line": 9, "column": 0 }, "end": { "line": 11, "column": 3 } } } ] }, { "type": "ExportNamedDeclaration", "start": 235, "end": 279, "loc": { "start": { "line": 12, "column": 0 }, "end": { "line": 12, "column": 44 } }, "specifiers": [], "source": null, "declaration": { "type": "VariableDeclaration", "start": 242, "end": 279, "loc": { "start": { "line": 12, "column": 7 }, "end": { "line": 12, "column": 44 } }, "declarations": [ { "type": "VariableDeclarator", "start": 248, "end": 279, "loc": { "start": { "line": 12, "column": 13 }, "end": { "line": 12, "column": 44 } }, "id": { "type": "Identifier", "start": 248, "end": 254, "loc": { "start": { "line": 12, "column": 13 }, "end": { "line": 12, "column": 19 }, "identifierName": "TRACKS" }, "name": "TRACKS", "leadingComments": null }, "init": { "type": "BinaryExpression", "start": 257, "end": 279, "loc": { "start": { "line": 12, "column": 22 }, "end": { "line": 12, "column": 44 } }, "left": { "type": "Identifier", "start": 257, "end": 267, "loc": { "start": { "line": 12, "column": 22 }, "end": { "line": 12, "column": 32 }, "identifierName": "API_DOMAIN" }, "name": "API_DOMAIN" }, "operator": "+", "right": { "type": "StringLiteral", "start": 270, "end": 279, "loc": { "start": { "line": 12, "column": 35 }, "end": { "line": 12, "column": 44 } }, "extra": { "rawValue": "tracks/", "raw": "'tracks/'" }, "value": "tracks/", "leadingComments": null, "trailingComments": null }, "trailingComments": null }, "leadingComments": null, "trailingComments": null } ], "kind": "const", "leadingComments": [ { "type": "CommentBlock", "value": "*\n * @ignore\n ", "start": 216, "end": 234, "loc": { "start": { "line": 9, "column": 0 }, "end": { "line": 11, "column": 3 } } } ], "trailingComments": [ { "type": "CommentBlock", "value": "*\n * @ignore\n ", "start": 281, "end": 299, "loc": { "start": { "line": 14, "column": 0 }, "end": { "line": 16, "column": 3 } } } ] }, "leadingComments": [ { "type": "CommentBlock", "value": "*\n * @ignore\n ", "start": 216, "end": 234, "loc": { "start": { "line": 9, "column": 0 }, "end": { "line": 11, "column": 3 } } } ], "trailingComments": [ { "type": "CommentBlock", "value": "*\n * @ignore\n ", "start": 281, "end": 299, "loc": { "start": { "line": 14, "column": 0 }, "end": { "line": 16, "column": 3 } } } ] }, { "type": "ExportNamedDeclaration", "start": 300, "end": 346, "loc": { "start": { "line": 17, "column": 0 }, "end": { "line": 17, "column": 46 } }, "specifiers": [], "source": null, "declaration": { "type": "VariableDeclaration", "start": 307, "end": 346, "loc": { "start": { "line": 17, "column": 7 }, "end": { "line": 17, "column": 46 } }, "declarations": [ { "type": "VariableDeclarator", "start": 313, "end": 346, "loc": { "start": { "line": 17, "column": 13 }, "end": { "line": 17, "column": 46 } }, "id": { "type": "Identifier", "start": 313, "end": 320, "loc": { "start": { "line": 17, "column": 13 }, "end": { "line": 17, "column": 20 }, "identifierName": "ARTISTS" }, "name": "ARTISTS", "leadingComments": null }, "init": { "type": "BinaryExpression", "start": 323, "end": 346, "loc": { "start": { "line": 17, "column": 23 }, "end": { "line": 17, "column": 46 } }, "left": { "type": "Identifier", "start": 323, "end": 333, "loc": { "start": { "line": 17, "column": 23 }, "end": { "line": 17, "column": 33 }, "identifierName": "API_DOMAIN" }, "name": "API_DOMAIN" }, "operator": "+", "right": { "type": "StringLiteral", "start": 336, "end": 346, "loc": { "start": { "line": 17, "column": 36 }, "end": { "line": 17, "column": 46 } }, "extra": { "rawValue": "artists/", "raw": "'artists/'" }, "value": "artists/", "leadingComments": null, "trailingComments": null }, "trailingComments": null }, "leadingComments": null, "trailingComments": null } ], "kind": "const", "leadingComments": [ { "type": "CommentBlock", "value": "*\n * @ignore\n ", "start": 281, "end": 299, "loc": { "start": { "line": 14, "column": 0 }, "end": { "line": 16, "column": 3 } } } ], "trailingComments": [ { "type": "CommentBlock", "value": "*\n * @ignore\n ", "start": 348, "end": 366, "loc": { "start": { "line": 19, "column": 0 }, "end": { "line": 21, "column": 3 } } } ] }, "leadingComments": [ { "type": "CommentBlock", "value": "*\n * @ignore\n ", "start": 281, "end": 299, "loc": { "start": { "line": 14, "column": 0 }, "end": { "line": 16, "column": 3 } } } ], "trailingComments": [ { "type": "CommentBlock", "value": "*\n * @ignore\n ", "start": 348, "end": 366, "loc": { "start": { "line": 19, "column": 0 }, "end": { "line": 21, "column": 3 } } } ] }, { "type": "ExportNamedDeclaration", "start": 367, "end": 411, "loc": { "start": { "line": 22, "column": 0 }, "end": { "line": 22, "column": 44 } }, "specifiers": [], "source": null, "declaration": { "type": "VariableDeclaration", "start": 374, "end": 411, "loc": { "start": { "line": 22, "column": 7 }, "end": { "line": 22, "column": 44 } }, "declarations": [ { "type": "VariableDeclarator", "start": 380, "end": 411, "loc": { "start": { "line": 22, "column": 13 }, "end": { "line": 22, "column": 44 } }, "id": { "type": "Identifier", "start": 380, "end": 386, "loc": { "start": { "line": 22, "column": 13 }, "end": { "line": 22, "column": 19 }, "identifierName": "ALBUMS" }, "name": "ALBUMS", "leadingComments": null }, "init": { "type": "BinaryExpression", "start": 389, "end": 411, "loc": { "start": { "line": 22, "column": 22 }, "end": { "line": 22, "column": 44 } }, "left": { "type": "Identifier", "start": 389, "end": 399, "loc": { "start": { "line": 22, "column": 22 }, "end": { "line": 22, "column": 32 }, "identifierName": "API_DOMAIN" }, "name": "API_DOMAIN" }, "operator": "+", "right": { "type": "StringLiteral", "start": 402, "end": 411, "loc": { "start": { "line": 22, "column": 35 }, "end": { "line": 22, "column": 44 } }, "extra": { "rawValue": "albums/", "raw": "'albums/'" }, "value": "albums/", "leadingComments": null, "trailingComments": null }, "trailingComments": null }, "leadingComments": null, "trailingComments": null } ], "kind": "const", "leadingComments": [ { "type": "CommentBlock", "value": "*\n * @ignore\n ", "start": 348, "end": 366, "loc": { "start": { "line": 19, "column": 0 }, "end": { "line": 21, "column": 3 } } } ], "trailingComments": [ { "type": "CommentBlock", "value": "*\n * @ignore\n ", "start": 413, "end": 431, "loc": { "start": { "line": 24, "column": 0 }, "end": { "line": 26, "column": 3 } } } ] }, "leadingComments": [ { "type": "CommentBlock", "value": "*\n * @ignore\n ", "start": 348, "end": 366, "loc": { "start": { "line": 19, "column": 0 }, "end": { "line": 21, "column": 3 } } } ], "trailingComments": [ { "type": "CommentBlock", "value": "*\n * @ignore\n ", "start": 413, "end": 431, "loc": { "start": { "line": 24, "column": 0 }, "end": { "line": 26, "column": 3 } } } ] }, { "type": "ExportNamedDeclaration", "start": 432, "end": 496, "loc": { "start": { "line": 27, "column": 0 }, "end": { "line": 27, "column": 64 } }, "specifiers": [], "source": null, "declaration": { "type": "VariableDeclaration", "start": 439, "end": 496, "loc": { "start": { "line": 27, "column": 7 }, "end": { "line": 27, "column": 64 } }, "declarations": [ { "type": "VariableDeclarator", "start": 445, "end": 496, "loc": { "start": { "line": 27, "column": 13 }, "end": { "line": 27, "column": 64 } }, "id": { "type": "Identifier", "start": 445, "end": 461, "loc": { "start": { "line": 27, "column": 13 }, "end": { "line": 27, "column": 29 }, "identifierName": "SHARED_PLAYLISTS" }, "name": "SHARED_PLAYLISTS", "leadingComments": null }, "init": { "type": "BinaryExpression", "start": 464, "end": 496, "loc": { "start": { "line": 27, "column": 32 }, "end": { "line": 27, "column": 64 } }, "left": { "type": "Identifier", "start": 464, "end": 474, "loc": { "start": { "line": 27, "column": 32 }, "end": { "line": 27, "column": 42 }, "identifierName": "API_DOMAIN" }, "name": "API_DOMAIN" }, "operator": "+", "right": { "type": "StringLiteral", "start": 477, "end": 496, "loc": { "start": { "line": 27, "column": 45 }, "end": { "line": 27, "column": 64 } }, "extra": { "rawValue": "shared-playlists/", "raw": "'shared-playlists/'" }, "value": "shared-playlists/", "leadingComments": null, "trailingComments": null }, "trailingComments": null }, "leadingComments": null, "trailingComments": null } ], "kind": "const", "leadingComments": [ { "type": "CommentBlock", "value": "*\n * @ignore\n ", "start": 413, "end": 431, "loc": { "start": { "line": 24, "column": 0 }, "end": { "line": 26, "column": 3 } } } ], "trailingComments": [ { "type": "CommentBlock", "value": "*\n * @ignore\n ", "start": 498, "end": 516, "loc": { "start": { "line": 29, "column": 0 }, "end": { "line": 31, "column": 3 } } } ] }, "leadingComments": [ { "type": "CommentBlock", "value": "*\n * @ignore\n ", "start": 413, "end": 431, "loc": { "start": { "line": 24, "column": 0 }, "end": { "line": 26, "column": 3 } } } ], "trailingComments": [ { "type": "CommentBlock", "value": "*\n * @ignore\n ", "start": 498, "end": 516, "loc": { "start": { "line": 29, "column": 0 }, "end": { "line": 31, "column": 3 } } } ] }, { "type": "ExportNamedDeclaration", "start": 517, "end": 575, "loc": { "start": { "line": 32, "column": 0 }, "end": { "line": 32, "column": 58 } }, "specifiers": [], "source": null, "declaration": { "type": "VariableDeclaration", "start": 524, "end": 575, "loc": { "start": { "line": 32, "column": 7 }, "end": { "line": 32, "column": 58 } }, "declarations": [ { "type": "VariableDeclarator", "start": 530, "end": 575, "loc": { "start": { "line": 32, "column": 13 }, "end": { "line": 32, "column": 58 } }, "id": { "type": "Identifier", "start": 530, "end": 543, "loc": { "start": { "line": 32, "column": 13 }, "end": { "line": 32, "column": 26 }, "identifierName": "MOOD_STATIONS" }, "name": "MOOD_STATIONS", "leadingComments": null }, "init": { "type": "BinaryExpression", "start": 546, "end": 575, "loc": { "start": { "line": 32, "column": 29 }, "end": { "line": 32, "column": 58 } }, "left": { "type": "Identifier", "start": 546, "end": 556, "loc": { "start": { "line": 32, "column": 29 }, "end": { "line": 32, "column": 39 }, "identifierName": "API_DOMAIN" }, "name": "API_DOMAIN" }, "operator": "+", "right": { "type": "StringLiteral", "start": 559, "end": 575, "loc": { "start": { "line": 32, "column": 42 }, "end": { "line": 32, "column": 58 } }, "extra": { "rawValue": "mood-stations/", "raw": "'mood-stations/'" }, "value": "mood-stations/", "leadingComments": null, "trailingComments": null }, "trailingComments": null }, "leadingComments": null, "trailingComments": null } ], "kind": "const", "leadingComments": [ { "type": "CommentBlock", "value": "*\n * @ignore\n ", "start": 498, "end": 516, "loc": { "start": { "line": 29, "column": 0 }, "end": { "line": 31, "column": 3 } } } ], "trailingComments": [ { "type": "CommentBlock", "value": "*\n * @ignore\n ", "start": 577, "end": 595, "loc": { "start": { "line": 34, "column": 0 }, "end": { "line": 36, "column": 3 } } } ] }, "leadingComments": [ { "type": "CommentBlock", "value": "*\n * @ignore\n ", "start": 498, "end": 516, "loc": { "start": { "line": 29, "column": 0 }, "end": { "line": 31, "column": 3 } } } ], "trailingComments": [ { "type": "CommentBlock", "value": "*\n * @ignore\n ", "start": 577, "end": 595, "loc": { "start": { "line": 34, "column": 0 }, "end": { "line": 36, "column": 3 } } } ] }, { "type": "ExportNamedDeclaration", "start": 596, "end": 664, "loc": { "start": { "line": 37, "column": 0 }, "end": { "line": 37, "column": 68 } }, "specifiers": [], "source": null, "declaration": { "type": "VariableDeclaration", "start": 603, "end": 664, "loc": { "start": { "line": 37, "column": 7 }, "end": { "line": 37, "column": 68 } }, "declarations": [ { "type": "VariableDeclarator", "start": 609, "end": 664, "loc": { "start": { "line": 37, "column": 13 }, "end": { "line": 37, "column": 68 } }, "id": { "type": "Identifier", "start": 609, "end": 627, "loc": { "start": { "line": 37, "column": 13 }, "end": { "line": 37, "column": 31 }, "identifierName": "FEATURED_PLAYLISTS" }, "name": "FEATURED_PLAYLISTS", "leadingComments": null }, "init": { "type": "BinaryExpression", "start": 630, "end": 664, "loc": { "start": { "line": 37, "column": 34 }, "end": { "line": 37, "column": 68 } }, "left": { "type": "Identifier", "start": 630, "end": 640, "loc": { "start": { "line": 37, "column": 34 }, "end": { "line": 37, "column": 44 }, "identifierName": "API_DOMAIN" }, "name": "API_DOMAIN" }, "operator": "+", "right": { "type": "StringLiteral", "start": 643, "end": 664, "loc": { "start": { "line": 37, "column": 47 }, "end": { "line": 37, "column": 68 } }, "extra": { "rawValue": "featured-playlists/", "raw": "'featured-playlists/'" }, "value": "featured-playlists/", "leadingComments": null, "trailingComments": null }, "trailingComments": null }, "leadingComments": null, "trailingComments": null } ], "kind": "const", "leadingComments": [ { "type": "CommentBlock", "value": "*\n * @ignore\n ", "start": 577, "end": 595, "loc": { "start": { "line": 34, "column": 0 }, "end": { "line": 36, "column": 3 } } } ], "trailingComments": [ { "type": "CommentBlock", "value": "*\n * @ignore\n ", "start": 666, "end": 684, "loc": { "start": { "line": 39, "column": 0 }, "end": { "line": 41, "column": 3 } } } ] }, "leadingComments": [ { "type": "CommentBlock", "value": "*\n * @ignore\n ", "start": 577, "end": 595, "loc": { "start": { "line": 34, "column": 0 }, "end": { "line": 36, "column": 3 } } } ], "trailingComments": [ { "type": "CommentBlock", "value": "*\n * @ignore\n ", "start": 666, "end": 684, "loc": { "start": { "line": 39, "column": 0 }, "end": { "line": 41, "column": 3 } } } ] }, { "type": "ExportNamedDeclaration", "start": 685, "end": 774, "loc": { "start": { "line": 42, "column": 0 }, "end": { "line": 42, "column": 89 } }, "specifiers": [], "source": null, "declaration": { "type": "VariableDeclaration", "start": 692, "end": 774, "loc": { "start": { "line": 42, "column": 7 }, "end": { "line": 42, "column": 89 } }, "declarations": [ { "type": "VariableDeclarator", "start": 698, "end": 774, "loc": { "start": { "line": 42, "column": 13 }, "end": { "line": 42, "column": 89 } }, "id": { "type": "Identifier", "start": 698, "end": 727, "loc": { "start": { "line": 42, "column": 13 }, "end": { "line": 42, "column": 42 }, "identifierName": "FEATURED_PLAYLISTS_CATEGORIES" }, "name": "FEATURED_PLAYLISTS_CATEGORIES", "leadingComments": null }, "init": { "type": "BinaryExpression", "start": 730, "end": 774, "loc": { "start": { "line": 42, "column": 45 }, "end": { "line": 42, "column": 89 } }, "left": { "type": "Identifier", "start": 730, "end": 740, "loc": {